Class: Tarantool::Client::Watcher
- Inherits:
-
Object
- Object
- Tarantool::Client::Watcher
- Defined in:
- tarantool-client/lib/tarantool/client/watcher.rb
Overview
Subscription returned by Client#watch.
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(key, watchers, callback) ⇒ Watcher
constructor
A new instance of Watcher.
- #unwatch ⇒ Object
Constructor Details
#initialize(key, watchers, callback) ⇒ Watcher
Returns a new instance of Watcher.
9 10 11 12 13 14 15 |
# File 'tarantool-client/lib/tarantool/client/watcher.rb', line 9 def initialize(key, watchers, callback) @key = key @watchers = watchers @callback = callback @active = true @notified = false end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'tarantool-client/lib/tarantool/client/watcher.rb', line 7 def key @key end |
Instance Method Details
#unwatch ⇒ Object
17 18 19 20 21 22 |
# File 'tarantool-client/lib/tarantool/client/watcher.rb', line 17 def unwatch @active = false @watchers.remove(self) nil end |