GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Mojo::RabbitMQ::Client::Consumer(3) User Contributed Perl Documentation Mojo::RabbitMQ::Client::Consumer(3)

Mojo::RabbitMQ::Client::Consumer - simple Mojo::RabbitMQ::Client based consumer

  use Mojo::RabbitMQ::Client::Consumer;
  my $consumer = Mojo::RabbitMQ::Consumer->new(
    url      => 'amqp://guest:guest@127.0.0.1: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;

Mojo::RabbitMQ::Client::Consumer inherits all events from Mojo::EventEmitter and can emit the following new ones.

Mojo::RabbitMQ::Client::Consumer has following attributes.

Mojo::RabbitMQ::Client::Consumer inherits all methods from Mojo::EventEmitter and implements the following new ones.

Mojo::RabbitMQ::Client

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.

2019-08-20 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.