AMQP
view release on metacpan or search on metacpan
lib/AMQP.pm view on Meta::CPAN
The AMQP class provides the basic functionality common to all AMQP utility classes.
=head1 METHODS
B<server($url)>
Configures all of the connection settings based on an AMQP url. The format of which is:
amqp://username:password@host:port/vhost
All of the elements of the url are required if you are not using the defaults. The default settings are:
amqp://guest:guest@localhost:5672/
=head1 TODO
=head1 BUGS
=head1 COPYRIGHT
Same as Perl.
lib/AMQP/Publisher.pm view on Meta::CPAN
Creates a new AMQP::Producer which can
Returns: new instance of this class.
B<server($url)>
Configures all of the connection settings based on an AMQP url. The format of which is:
amqp://username:password@host:port/vhost
All of the elements of the url are required if you are not using the defaults. The default settings are:
amqp://guest:guest@localhost:5672/
B<attach()>
Connects to the AMQP server specified by the C<server()> method. When the server connects it will invoke the publisher's C<on_connect()>
callback. This can enable you to setup additional event loops to drive the publisher.
B<send()>
lib/AMQP/Subscriber.pm view on Meta::CPAN
whatever is in C<\%params>, which are not predefined.</p>
Returns: new instance of this class.
B<server($url)>
Configures all of the connection settings based on an AMQP url. The format of which is:
amqp://username:password@host:port/vhost
All of the elements of the url are required if you are not using the defaults. The default settings are:
amqp://guest:guest@localhost:5672/
B<attach()>
=head1 TODO
=head1 BUGS
t/subscriber.t view on Meta::CPAN
use Test::More;
use Test::Mojo;
use lib './lib';
require_ok('AMQP::Subscriber');
my $s = AMQP::Subscriber->new;
isa_ok($s,'AMQP::Subscriber');
# Test overriding the defaults
$s->server('amqp://foo:bar@test:25672/test');
is($s->host, 'test', 'host set');
is($s->port, 25672, 'port set');
is($s->vhost, 'test', 'vhost set');
is($s->username, 'foo', 'user set');
is($s->password, 'bar', 'password set');
# Test the defaults
$s->server();
is($s->host, 'localhost', 'localhost default');
is($s->port, 5672, 'port default');
is($s->vhost, '/', 'vhost default');
is($s->username, 'guest', 'user default');
is($s->password, 'guest', 'password default');
done_testing();
( run in 0.445 second using v1.01-cache-2.11-cpan-0a6323c29d9 )