The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Async::AMQP::RPC::Server - server RPC handling

VERSION

version 2.000

DESCRIPTION

Provides a basic server implementation for RPC handling.

  • Declare a queue

  • Declare the RPC exchange

  • Bind our queue to the exchange

  • Start a consumer on the queue

  • For each message, process via subclass-defined handlers and send a reply to the default ('') exchange with the reply_to as the routing key

queue

Returns the server Net::Async::AMQP::Queue instance.

json

Returns a JSON::MaybeXS object, for ->encode and ->decode support. This will load JSON::MaybeXS on first call.

process_message

Called when there is a message to process. Receives several named parameters:

configure

Applies configuration:

  • json_handler - defines the JSON handlers for each type

  • handler - defines default handlers

INHERITED METHODS

Net::Async::AMQP::RPC::Base

active, client_queue, connected, consumer, consumer_channel, exchange, future, mq, on_message, publisher_channel, queue_name, reply, routing_key, server_queue

IO::Async::Notifier

add_child, adopt_future, can_event, children, configure_unknown, debug_printf, get_loop, invoke_error, invoke_event, loop, make_event_cb, maybe_invoke_event, maybe_make_event_cb, new, notifier_name, parent, remove_child, remove_from_parent

AUTHOR

Tom Molesworth <TEAM@cpan.org>

LICENSE

Licensed under the same terms as Perl itself, with additional licensing terms for the MQ spec to be found in share/amqp0-9-1.extended.xml ('a worldwide, perpetual, royalty-free, nontransferable, nonexclusive license to (i) copy, display, distribute and implement the Advanced Messaging Queue Protocol ("AMQP") Specification').