From aadf54194df07a2460724130e0e176caca95f65d Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 16 Feb 2012 23:47:48 -0600 Subject: docs --- lib/Net/Flowdock/Stream.pm | 106 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) (limited to 'lib') diff --git a/lib/Net/Flowdock/Stream.pm b/lib/Net/Flowdock/Stream.pm index 7b7603d..1ebeca8 100644 --- a/lib/Net/Flowdock/Stream.pm +++ b/lib/Net/Flowdock/Stream.pm @@ -1,25 +1,76 @@ package Net::Flowdock::Stream; use Moose; +# ABSTRACT: Streaming API for Flowdock use JSON; use MIME::Base64; use Net::HTTPS::NB; +=head1 SYNOPSIS + + my $stream = Net::Flowdock::Stream->new( + token => '...', + flows => ['myorg/testing'], + ); + + while (1) { + if (my $event = $stream->get_next_event) { + process_event($event); + } + } + +=head1 DESCRIPTION + +This module implements the streaming api for +L. It provides a non-blocking method which +you can call to get the next available event in the stream. You can then +integrate this method into your existing event-driven app. + +=cut + +=attr token + +Your account's API token, for authentication. Required unless C and +C are provided. + +=cut + has token => ( is => 'ro', isa => 'Str', ); +=attr email + +Your account's email address, for authentication. Required unless C is +provided. + +=cut + has email => ( is => 'ro', isa => 'Str', ); +=attr password + +Your account's password, for authentication. Required unless C is +provided. + +=cut + has password => ( is => 'ro', isa => 'Str', ); +=attr flows + +An arrayref of flows that should be listened to for events. Note that the flow +names must include the organization, so C, not just C. + +=cut + has flows => ( traits => ['Array'], isa => 'ArrayRef[Str]', @@ -91,6 +142,13 @@ sub BUILD { $self->_socket($s); } +=method get_next_event + +Returns the next event that has been received in the stream. This call is +nonblocking, and will return undef if no events are currently available. + +=cut + sub get_next_event { my $self = shift; @@ -151,4 +209,52 @@ sub _process_readbuf { __PACKAGE__->meta->make_immutable; no Moose; +=head1 BUGS + +No known bugs. + +Please report any bugs through RT: email +C, or browse to +L. + +=head1 SEE ALSO + +L + +=head1 SUPPORT + +You can find this documentation for this module with the perldoc command. + + perldoc Net::Flowdock::Stream + +You can also look for information at: + +=over 4 + +=item * AnnoCPAN: Annotated CPAN documentation + +L + +=item * CPAN Ratings + +L + +=item * RT: CPAN's request tracker + +L + +=item * Search CPAN + +L + +=back + +=begin Pod::Coverage + +BUILD + +=end Pod::Coverage + +=cut + 1; -- cgit v1.2.3