AnyEvent::CouchDB

A non-blocking CouchDB client based on jquery.couch.js
Download

AnyEvent::CouchDB Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • John BEPPU
  • Publisher web site:
  • http://search.cpan.org/~beppu/

AnyEvent::CouchDB Tags


AnyEvent::CouchDB Description

A non-blocking CouchDB client based on jquery.couch.js The AnyEvent::CouchDB module is a non-blocking CouchDB client implemented on top of the AnyEvent framework. Using this library will give you the ability to run many CouchDB requests asynchronously, and it was intended to be used within a Coro+AnyEvent environment. However, it can also be used synchronously if you want.Its API is based on jquery.couch.js, but we've adapted the API slightly so that it makes sense in an asynchronous Perl environment.SYNOPSISGetting information about a CouchDB server: use AnyEvent::CouchDB; use Data::Dump 'pp'; my $couch = couch('http://localhost:5984/'); print pp( $couch->all_dbs->recv ), "\n"; print pp( $couch->info->recv ), "\n";Get an object representing a CouchDB database: my $db = $couch->db('database'); $db = couchdb('database'); $db = couchdb('http://somewhere.com:7777/database/');Work with individual CouchDB documents; my $user = $db->open_doc('~larry')->recv; $user->{name} = "larry"; $db->save_doc($user)->recv;Query a view: $db->view('users/all', { startkey => 'b', endkey => 'bZZZ' })->recvFinally, an asynchronous example: # Calling cb will not block whereas calling recv *will* block. $db->all_docs->cb(sub { my ($cv) = @_; print pp( $cv->recv ), "\n"; }); # However, you have to be in an event loop at some point in time. AnyEvent->condvar->recv; Requirements: · Perl


AnyEvent::CouchDB Related Software