Class: IOPromise::Memcached::MemcachePromise
- Defined in:
- lib/iopromise/memcached/promise.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #execute_pool ⇒ Object
-
#initialize(client = nil, key = nil) ⇒ MemcachePromise
constructor
A new instance of MemcachePromise.
- #wait ⇒ Object
Methods inherited from Base
#beginning, #fulfill, #instrument, #notify_completion, #reject, #started_executing?
Constructor Details
#initialize(client = nil, key = nil) ⇒ MemcachePromise
Returns a new instance of MemcachePromise.
10 11 12 13 14 15 16 17 |
# File 'lib/iopromise/memcached/promise.rb', line 10 def initialize(client = nil, key = nil) super() @client = client @key = key ::IOPromise::ExecutorContext.current.register(self) unless @client.nil? || @key.nil? end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
8 9 10 |
# File 'lib/iopromise/memcached/promise.rb', line 8 def key @key end |
Instance Method Details
#execute_pool ⇒ Object
27 28 29 |
# File 'lib/iopromise/memcached/promise.rb', line 27 def execute_pool MemcacheExecutorPool.for(@client) end |
#wait ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/iopromise/memcached/promise.rb', line 19 def wait if @client.nil? || @key.nil? super else ::IOPromise::ExecutorContext.current.wait_for_all_data(end_when_complete: self) end end |