Daemonise::Plugin::RabbitMQ - Daemonise RabbitMQ plugin
version 2.13
use Daemonise; my $d = Daemonise->new(); # this is the rabbitMQ queue name we eventually create and subscribe to $d->name("queue_name"); $d->debug(1); $d->foreground(1) if $d->debug; $d->config_file('/path/to/some.conf'); $d->load_plugin('RabbitMQ'); $d->is_worker(1); # make it create its own queue $d->configure; # fetch next message from our subscribed queue $msg = $d->dequeue; # send message to some_queue and don't wait (rabbitMQ publish) # $msg can be anything that encodes into JSON $d->queue('some_queue', $msg); # send message and wait for response (rabbitMQ RPC) my $response = $d->queue('some_queue', $msg); # worker that wants a reply from us, not necessarily from an RPC call my $worker = $d->reply_queue; # does NOT reply to caller, no matter what, usually not what you want $d->dont_reply; # at last, acknowledge message as processed $d->ack;
Lenz Gschwendtner <norbu09@cpan.org>
This software is copyright (c) 2013 by Lenz Gschwendtner.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Daemonise, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Daemonise
CPAN shell
perl -MCPAN -e shell install Daemonise
For more information on module installation, please visit the detailed CPAN module installation guide.