Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 4104d46e71
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (28 sloc) 1.039 kb

EXAMPLE

Like any Deferrable eventmachine-based protocol implementation, using EM-Couchbase involves making calls and passing blocks that serve as callbacks when the call returns.

require 'em-couchbase'

EM.run do
  couchbase = EM::Protocols::Couchbase.connect
  couchbase.set "a", "foo" do |response|
    if response.success?
      couchbase.get "a" do |response|
        puts response.inspect
      end
    end
  end
  couchbase.incr "bar", :initial => 100500 do |response|
    if response.success?
      couchbase.get "bar" do |response|
        puts response.inspect
        EM.stop
      end
    end
  end
end

SUPPORT

If you found an issue, please file it in our JIRA. Also you are always welcome on #libcouchbase channel at freenode.net IRC servers.

Documentation: http://rdoc.info/gems/couchbase-em

Jump to Line
Something went wrong with that request. Please try again.