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


AnyEvent-CouchDB documentation  | view source Contained in the AnyEvent-CouchDB distribution.

Index


NAME

Top

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

SYNOPSIS

Top

  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

Top

AnyEvent::CouchDB::Stream is an interface to the CouchDB changes database API.

OPTIONS

url

URL of the CouchDB host

database

Name of the CouchDB database

filter

Name of the filter to execute on this notifier

on_change

A code ref to execute when a change notification is received

on_keepalive

A code ref to execute when keepalive is called

on_error

A code ref to execute on error

on_eof

A code ref to execute on eof

AUTHOR

Top

franck cuny <franck.cuny@linkfluence.net>

SEE ALSO

Top

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

LICENSE

Top

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.


AnyEvent-CouchDB documentation  | view source Contained in the AnyEvent-CouchDB distribution.