Class: Estore::Commands::Promise
- Inherits:
-
Promise
- Object
- Promise
- Estore::Commands::Promise
- Defined in:
- lib/estore/commands/promise.rb
Instance Attribute Summary collapse
-
#correlation_id ⇒ Object
readonly
Returns the value of attribute correlation_id.
Instance Method Summary collapse
-
#initialize(correlation_id) ⇒ Promise
constructor
A new instance of Promise.
- #wait ⇒ Object
Constructor Details
#initialize(correlation_id) ⇒ Promise
Returns a new instance of Promise.
6 7 8 9 |
# File 'lib/estore/commands/promise.rb', line 6 def initialize(correlation_id) super() @correlation_id = correlation_id end |
Instance Attribute Details
#correlation_id ⇒ Object (readonly)
Returns the value of attribute correlation_id.
4 5 6 |
# File 'lib/estore/commands/promise.rb', line 4 def correlation_id @correlation_id end |
Instance Method Details
#wait ⇒ Object
11 12 13 14 15 16 |
# File 'lib/estore/commands/promise.rb', line 11 def wait t = Thread.current resume = proc { t.wakeup } self.then(resume, resume) sleep end |