rybakit / phive-queue Goto Github PK
View Code? Open in Web Editor NEW$queue->push('I can be popped off after', '10 minutes');
License: MIT License
$queue->push('I can be popped off after', '10 minutes');
License: MIT License
The documentation does not mention anything about closures but it appears that those are supported by InMemoryQueue. Please consider the following scenario:
$queue = new InMemoryQueue();
$queue->push(function() {
return 'Example with closures';
});
$item = $queue->pop();
echo $item();
The above scenario is executed successfully, printing "Example with closures". Some other Queue Types may not support this directly, but we can serialise closures using jeremeamia/SuperClosure library.
Are there any plans to support closures?
Options:
Remove count()
method from queues
Leave count()
and add Countable
interface:
class InMemoryQueue implements Queue, \Countable
{
...
public function count()
{
...
}
}
count()
into separate interface:interface AdvancedQueue extends Queue, \Countable
{
public function slice($offset, $limit);
}
interface OuterQueue extends Queue
{
/**
* @return Queue
*/
public function getInnerQueue();
}
class TypeSafeQueue implements OuterQueue
{
...
}
or
interface QueueAware
{
/**
* @return Queue
*/
public function getQueue();
}
class TypeSafeQueue implements Queue, QueueAware
{
...
}
E.g. RedisQueue and SysVQueue have build in support for data serialization
I have taken a cursory glance at the package, and my initial answer is "maybe", but since you are the author, you might have a better idea.
One potential issue is needing to handle exchange/routing_key/queue semantics, which I don't know if any of your drivers currently handle.
Can kafka be supported,I unfamiliar with it。
[2021-04-10T11:28:33+08:00][error] Type: ErrorException; Message: Function Redis::evaluate() is deprecated; File: C:\Users\Zsoner\Desktop\RaxChat\workerman\vendor\rybakit\phive-queue\src\RedisQueue.php; Line: 52;
#0 C:\Users\Zsoner\Desktop\RaxChat\workerman\vendor\rybakit\phive-queue\src\RedisQueue.php(52): log_error(8192, 'Function Redis:...', 'C:\Users\Zsoner...', 52, Array)
#1 C:\Users\Zsoner\Desktop\RaxChat\workerman\core\functions.php(412): Phive\Queue\RedisQueue->push('{"from":"100000...')
#2 C:\Users\Zsoner\Desktop\RaxChat\workerman\RaxChat\app\model\Message.php(281): addToQueue('insert_message', Array)
#3 C:\Users\Zsoner\Desktop\RaxChat\workerman\RaxChat\app\service\Joke.php(21):
I'm looking at existing PHP libraries for scheduling jobs at a given date or with a given delay. A requirement however is that a job that gets scheduled, can be cancelled later on. phive-queue looks great, but it currently lacks this feature.
Not all storage backends supported by phive-queue support cancelling queued items. To get this implemented, I think a second interface next to Queue will be needed. This interface might be called "CancellableQueue". Implementations that have cancel support can implement the additional methods of this new interface.
The unique identifier of a scheduled job could be returned by Queue::push(). Implementations that do not support job IDs can just return void. You could also leave Queue::push() alone, and add a new method getLastPushedId() that returns the ID of the last pushed job.
Are you interested in adopting this feature in phive-queue? My team probably can contribute interfaces and implementations for PDO and Beanstalkd.
Keywords in composer.json
are not distinct array entries. As a result, keywords are being displaying as one long-keyword under Packagist Project website. Have a look at https://packagist.org/packages/rybakit/phive-queue
An array of keywords that the package is related to. These can be used for searching and filtering
https://getcomposer.org/doc/04-schema.md#keywords
I hope support "ext:php_ds queue", SplQueue, Predis, Kalfka, etc. Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.