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::Method(3) User Contributed Perl Documentation Mojo::RabbitMQ::Client::Method(3)

Mojo::RabbitMQ::Client::Method - it's a generic class for all AMQP method calls

  use Mojo::RabbitMQ::Client::Method;

  my $method = Mojo::RabbitMQ::Client::Method->new(
    client => $client,
    channel => $channel
  )->setup(
    'Basic::Consume' => {
      ...
    },
    ['Basic::ConsumeOk', ...]
  );

  # Watch for errors
  $method->on(error => sub { warn "Error in reception: " . $_[1] });

  # Send this frame to AMQP
  $method->deliver;

Mojo::RabbitMQ::Client::Method is general class for every AMQP method call.

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

  $method->on(success => sub {
    my ($method, $frame) = @_;
    ...
  });

Emitted when one of expected replies is received.

Can be emitted by consumption & get methods.

Can be emitted by get method, when no messages are available on queue.

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

  $method->is_sent ? "Method was sent" : "Method is still pending delivery";

  my $client = $method->client;
  $method->client($client);

  my $name = $method->name;
  $method->name('Basic::Get');

  my $arguments = $method->arguments;
  $method->arguments({no_ack => 1, ticket => 0, queue => 'amq.queue'});

  my $expectations = $method->expect;
  $method->expect([qw(Basic::GetOk Basic::GetEmpty)]);

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

  $method = $method->setup($name, $arguments, $expectations);

Sets AMQP method name, its arguments and expected replies.

  my $status = $method->deliver();

  This delivers AMQP method call to server. Returns C<<false>> when channel is not open, C<<true>> otherwise.
  On successful delivery->reply cycle emits C<<success>> event.
  C<<error>> is emitted when none of expected replies are received.

Mojo::RabbitMQ::Client::Channel, Mojo::RabbitMQ::Client

Copyright (C) 2015-2017, Sebastian Podjasek and others

Based on AnyEvent::RabbitMQ - Copyright (C) 2010 Masahito Ikuta, maintained by "bobtfish@bobtfish.net"

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.