
Mvalve - Generic Q4M Powered Message Pipe

my $mvalve = Mvalve->new(
state => {
module => "...",
},
queue => {
module => "...",
connect_info => [ ... ]
},
throttler => {
module => 'Data::Throttler::Memcached',
max_items => $max,
interval => $interval,
cache => {
data => [ ... ]
}
}
);
while ( 1 ) {
my $message = $mvalve->next;
if ($message) {
# do whatever
}
}

Mvalve stands for "Messave Valve". It is a frontend for Q4M powered set of queues, acting as a single pipe.

Fetches the next available message.
Inserts into the normal queue
Inserts in the the retry_wait queue.
Checks whethere there are pending retries for that particular destination.
throttler holds the Data::Throttler instance that does the dirty work of determining if a message needs to be throttled or not
$self->throttler( {
module => "Data::Throttler::Memcached",
} );
timeout specifies the timeout value while we wait to read from the queue.
queue is the actual queue instance that we'll be dealing with. While the architecture is such that you can replace the queue with your custom object, we currently only support Q4M
$self->queue( {
module => "Q4M",
connect_info => [ 'dbi:mysql:...', ..., ... ]
} );
Clears all known queues that are listed under the registered QueueSet
This is for debugging only


Daisuke Maki <daisuke@endeworks.jp>
Taro Funaki <t@33rpm.jp>

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.