Class: ZooKeeper

Inherits:
Object
  • Object
show all
Defined in:
lib/zookeeper.rb,
lib/zookeeper/id.rb,
lib/zookeeper/acl.rb,
lib/zookeeper/stat.rb,
lib/zookeeper/locker.rb,
lib/zookeeper/logging.rb,
lib/zookeeper/permission.rb,
lib/zookeeper/message_queue.rb,
lib/zookeeper/event_handler.rb,
lib/zookeeper/watcher_event.rb,
lib/zookeeper/connection_pool.rb,
lib/zookeeper/event_handler_subscription.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Permission Classes: ACL, ConnectionPool, EventHandler, EventHandlerSubscription, Id, Locker, MessageQueue, Stat, WatcherEvent

Constant Summary

DEFAULTS =
{
  :timeout => 10000
}

Instance Method Summary (collapse)

Instance Method Details

- (Object) locker(name)

creates a new locker based on the name you send in

Examples:

zk.locker("blah").lock!

Parameters:

  • name (String)

    the name of the lock you wish to use

Returns:

  • ZooKeeper::Locker the lock using this connection and name

See Also:



39
40
41
# File 'lib/zookeeper.rb', line 39

def locker(name)
  Locker.new(self, name)
end

- (ZooKeeper::MessageQueue) queue(name)

creates a new message queue of name name

Examples:

zk.queue("blah").publish({:some_data => "that is yaml serializable"})

Parameters:

  • name (String)

    the name of the queue

Returns:

See Also:



49
50
51
# File 'lib/zookeeper.rb', line 49

def queue(name)
  MessageQueue.new(self, name)
end