NAME

Mojo::RabbitMQ::Client::Publisher - simple Mojo::RabbitMQ::Client based publisher

SYNOPSIS

use Mojo::RabbitMQ::Client::Publisher;
my $publisher = Mojo::RabbitMQ::Client::Publisher->new(
  url => 'amqp://guest:guest@127.0.0.1:5672/?exchange=mojo&queue=mojo'
);

$publisher->catch(sub { die "Some error caught in Publisher" } );
$publisher->on('success' => sub { say "Publisher ready" });

$publisher->publish('plain text');
$publisher->publish({encode => { to => 'json'}});

Mojo::IOLoop->start unless Mojo::IOLoop->is_running;

DESCRIPTION

EVENTS

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

ATTRIBUTES

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

METHODS

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

SEE ALSO

Mojo::RabbitMQ::Client

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.