Mojo::RabbitMQ::Client::Consumer3pm
Simple mojo::rabbitmq::client based consumer
Usage
use Mojo::RabbitMQ::Client::Consumer;my $consumer = Mojo::RabbitMQ::Consumer->new(url => 'amqp://guest:[email protected]:5672/?exchange=mojo&queue=mojo',defaults => {qos => {prefetch_count => 1},queue => {durable => 1},consumer => {no_ack => 0},});$consumer->catch(sub { die "Some error caught in Consumer" } );$consumer->on('success' => sub { say "Consumer ready" });$consumer->on('message' => sub {my ($consumer, $message) = @_;$consumer->channel->ack($message)->deliver;});$consumer->consume_p->wait;Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
Overview
Events
Mojo::RabbitMQ::Client::Consumer inherits all events from Mojo::EventEmitter and can emit the following new ones.
Attributes
Mojo::RabbitMQ::Client::Consumer has following attributes.
Methods
Mojo::RabbitMQ::Client::Consumer inherits all methods from Mojo::EventEmitter and implements the following new ones.
Copyright and license
Copyright (C) 2015-2017, Sebastian Podjasek and others
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
Releases
4 releases since Debian 10 (Buster); the text changed 2 times.