cog / stupidmq
stupid message queue
Installs: 14 365
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=5.3.3
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2022-02-01 12:22:31 UTC
README
Message Queue based on Symfony Components
Usage
Be carefull : FileAdapter is not yet working, please use AdapterPdoMysql instead.
Providing messages :
$adpater = new \Cog\StupiMQ\AdapterFile( sys_get_temp_dir() ); $channel = new \Cog\StupiMQ\Channel( $adapter ); $queue = new \Cog\StupiMQ\Queue( $channel, 'myQueue' ); $queue->publish( 'hello world' );
Consuming messages :
$adpater = new \Cog\StupiMQ\AdapterFile( sys_get_temp_dir() ); $channel = new \Cog\StupiMQ\Channel( $adapter ); $queue = new \Cog\StupiMQ\Queue( $channel, 'myQueue' ); $message = $queue->consume();
Giving feedback
$adpater = new \Cog\StupiMQ\AdapterFile( sys_get_temp_dir() ); $channel = new \Cog\StupiMQ\Channel( $adapter ); $queue = new \Cog\StupiMQ\Queue( $channel, 'myQueue' ); $message = $queue->consume(); $queue->feedback( $message-getId(), CoG\StupidMQ\Message\MessageInterface::STATE_DONE), 'my feedback' );
Todo
- Terminate FileAdapter