Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.
/ couchchanges Public archive
forked from vangberg/couchchanges

ruby consumer for couchdb's _changes feed

Notifications You must be signed in to change notification settings

assaydepot/couchchanges

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

couchchanges

a ruby consumer for couchdb's _changes feed. eventmachine based.

example.rb

require "eventmachine"
require "couchchanges"

EventMachine.run {
  couch = CouchChanges.new :url => "http://127.0.0.1:5984/my_db"

  couch.change {|change|
    puts "doc created, updated or deleted"
  }
  couch.update {|change|
    puts "doc created or updated"
  }
  couch.delete {|change|
    puts "doc deleted"
  }

  # if you don't specify a disconnect block, couchchanges will
  # automatically reconnect to couchdb. normally you shouldn't
  # care about the disconnect callback, but it can come in
  # handy in tests etc.
  couch.disconnect {|last_seq|
    puts "disconnected from couch. last_seq: #{last_seq}"
  }
  
  couch.listen
}

About

ruby consumer for couchdb's _changes feed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%