AnyEvent::Atom::Stream - XML::Atom::Stream with AnyEvent
use AnyEvent::Atom::Stream; my $url = "http://updates.sixapart.com/atom-stream.xml"; my $cv = AnyEvent->condvar; # API is compatible to XML::Atom::Stream my $client = AnyEvent::Atom::Stream->new( callback => \&callback, timeout => 30, on_disconnect => $cv, ); my $guard = $client->connect($url); $cv->recv; sub callback { my($atom) = @_; # $atom is a XML::Atom::Feed object }
AnyEvent::Atom::Stream is an XML::Atom::Stream subclass that uses AnyEvent::HTTP and thus allows you to run the stream listener using any of AnyEvent event loop implementation.
$client = AnyEvent::Atom::Stream->new( callback => \&callback, timeout => 30, on_disconnect => $cv, );
Creates a new AnyEvent::Atom::Stream instance. The API is compatible to XML::Atom::Stream, but it doesn't support reconnect parameter, because that's something you can easily control with the new on_disconnect AnyEvent callback.
reconnect
$guard = $client->connect($url);
Connects and receives Atom update stream.
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
XML::Atom::Stream, AnyEvent::HTTP, http://updates.sixapart.com/
To install AnyEvent::Atom::Stream, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyEvent::Atom::Stream
CPAN shell
perl -MCPAN -e shell install AnyEvent::Atom::Stream
For more information on module installation, please visit the detailed CPAN module installation guide.