AnyEvent::WebService::Notifo - AnyEvent-powered client for the notifo.com API
version 0.001
use AnyEvent; use AnyEvent::WebService::Notifo; # Uses the default values obtained from configuration file my $awn = AnyEvent::WebService::Notifo->new; # ... or just pass them in my $awn = AnyEvent::WebService::Notifo->new( api_key => 'api_key_value', user => 'api_user', ); # a coderef as a callback is one possibility... $awn->send_notification(msg => 'my nottification text', cb => sub { my ($res) = @_; # $res is our response }); # ... or a condvar my $cv = AE::cv; $awn->send_notification(msg => 'my nottification text', cb => $cv); $res = $cv->recv; # $res is our response
A client for the http://notifo.com/ API using the AnyEvent framework.
Creates a new AnyEvent::WebService::Notifo object. See Protocol::Notifo->new() for a explanation of the parameters and the configuration file used for default values.
AnyEvent::WebService::Notifo
Sends a notification.
It accepts a hash with parameters. We require a cb parameter. This must be a coderef or a condvar, that will be called with the response.
cb
In void context, this method returns nothing. In scalar context, it returns a guard object. If this object goes out of scope, the request is canceled. So you need to keep this guard object alive until your callback is called.
See Protocol::Notifo->send_notification() for list of parameters that this method accepts, and an explanation of the response that the callback receives.
Protocol::Notifo, AnyEvent
Pedro Melo <melo@simplicidade.org>
This software is Copyright (c) 2010 by Pedro Melo.
This is free software, licensed under:
The Artistic License 2.0
To install AnyEvent::WebService::Notifo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyEvent::WebService::Notifo
CPAN shell
perl -MCPAN -e shell install AnyEvent::WebService::Notifo
For more information on module installation, please visit the detailed CPAN module installation guide.