cog/stupidmq

This package is abandoned and no longer maintained. No replacement package was suggested.

stupid message queue

1.0.1 2014-08-07 07:10 UTC

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