GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ANYEVENT::COUCHDB::STREAM (3)

.ds Aq ’

NAME

AnyEvent::CouchDB::Stream - Watch changes from a CouchDB database.

CONTENTS

SYNOPSIS



  use AnyEvent::CouchDB::Stream;
  my $listener = AnyEvent::CouchDB::Stream->new(
      url       => http://localhost:5984,
      database  => test,
      on_change => sub {
          my $change = shift;
          warn "document $change->{_id} updated";
      },
      on_keepalive => sub {
          warn "ping\n";
      },
      timeout => 1,
  );



DESCRIPTION

AnyEvent::CouchDB::Stream is an interface to the CouchDB <B>changesB> database API.

    OPTIONS

<B>urlB> URL of the CouchDB host.
<B>databaseB> Name of the CouchDB database.
<B>timeoutB> Number of seconds to wait before timing out. On timeout, The on_error code ref will be called with an argument of ’timeout’.
<B>filterB> Name of the filter to execute on this notifier.
<B>sinceB> Number to fetch changes from. Defaults to 1.
<B>on_changeB> A code ref to execute when a change notification is received. It is mandatory.
<B>on_keepaliveB> A code ref to execute when keepalive is called.
<B>on_errorB> A code ref to execute on error. Code ref is passed the error message.
<B>on_eofB> A code ref to execute on eof
<B>headersB> An optional hashref of headers that should be used for the HTTP request. Defaults to { Content-Type = ’application/json’ } >.
<B>heartbeatB> The interval in milliseconds between newlines sent from the server to ensure that an open connection is still being maintained

AUTHOR

franck cuny <franck.cuny@linkfluence.net>

SEE ALSO

AnyEvent::HTTP, AnyEvent::CouchDB, AnyEvent::Twitter::Stream, <http://books.couchdb.org/relax/reference/change-notifications>

LICENSE

Copyright 2010 by Linkfluence

<http://linkfluence.net>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ANYEVENT::COUCHDB::STREAM (3) 2012-07-26

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.