Class: Tupelo::Client::WaiterBase
Instance Attribute Summary collapse
-
#once ⇒ Object
readonly
Returns the value of attribute once.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
- #gloms(tuple) ⇒ Object
-
#initialize(template, client, once = true) ⇒ WaiterBase
constructor
A new instance of WaiterBase.
- #inspect ⇒ Object
- #peek(tuple) ⇒ Object
- #wait ⇒ Object
Constructor Details
#initialize(template, client, once = true) ⇒ WaiterBase
Returns a new instance of WaiterBase.
61 62 63 64 65 66 |
# File 'lib/tupelo/client/reader.rb', line 61 def initialize template, client, once = true @template = template @queue = client.make_queue @client = client @once = once end |
Instance Attribute Details
#once ⇒ Object (readonly)
Returns the value of attribute once.
59 60 61 |
# File 'lib/tupelo/client/reader.rb', line 59 def once @once end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
58 59 60 |
# File 'lib/tupelo/client/reader.rb', line 58 def queue @queue end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
57 58 59 |
# File 'lib/tupelo/client/reader.rb', line 57 def template @template end |
Instance Method Details
#gloms(tuple) ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/tupelo/client/reader.rb', line 68 def gloms tuple if template === tuple peek tuple else false end end |
#inspect ⇒ Object
88 89 90 |
# File 'lib/tupelo/client/reader.rb', line 88 def inspect "<#{self.class}: #{template.inspect}>" end |
#peek(tuple) ⇒ Object
76 77 78 79 |
# File 'lib/tupelo/client/reader.rb', line 76 def peek tuple queue << tuple once end |
#wait ⇒ Object
81 82 83 84 85 86 |
# File 'lib/tupelo/client/reader.rb', line 81 def wait @client.log.debug {"waiting for #{inspect}"} r = queue.pop @client.log.debug {"finished waiting for #{inspect}"} r end |