AMQP
view release on metacpan or search on metacpan
lib/AMQP/Subscriber.pm view on Meta::CPAN
say "Failed to read" if $self->debug;
$self->status->send;
},
on_return => sub {
say "Failed to send" if $self->debug;
$self->status->send;
},
on_close => sub {
say "Connection closed" if $self->debug;
$self->status->send;
}
);
$self->status->recv;
}
1;
__END__
=pod
=head1 NAME
AMQP::Subscriber -- Listens for messages on a queue and does stuff with them.
=head1 SYNOPSIS
use AMQP::Subscriber;
my $subscriber = AMQP::Subscriber->new;
$subscriber->server('amqp://foo:bar@localhost:5672/testing');
$subscriber->exchange('test');
$subscriber->type('topic');
$subscriber->queue('testing');
$subscriber->callback( sub {
my ($self,$message) = @_;
say $message;
});
$subscriber->attach;
=head1 DESCRIPTION
The AMQP::Subscriber wraps
=head1 METHODS
B<new( \%params )> (constructor)
Create a new instance of this class. Initialize the object with
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
If you find them out
=head1 COPYRIGHT
Same as Perl.
=head1 AUTHORS
Dave Goehrig <dave@dloh.org>
=cut
( run in 0.679 second using v1.01-cache-2.11-cpan-39bf76dae61 )