Class: Tupelo::Client::NotifyWaiter

Inherits:
Object
  • Object
show all
Defined in:
lib/tupelo/client/reader.rb

Overview

Instrumentation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ NotifyWaiter

Returns a new instance of NotifyWaiter.



119
120
121
122
# File 'lib/tupelo/client/reader.rb', line 119

def initialize client
  @client = client
  @queue = client.make_queue
end

Instance Attribute Details

#queueObject (readonly)

Returns the value of attribute queue.



117
118
119
# File 'lib/tupelo/client/reader.rb', line 117

def queue
  @queue
end

Instance Method Details

#<<(event) ⇒ Object



124
125
126
# File 'lib/tupelo/client/reader.rb', line 124

def << event
  queue << event
end

#inspectObject



136
137
138
# File 'lib/tupelo/client/reader.rb', line 136

def inspect
  to_s
end

#toggleObject



132
133
134
# File 'lib/tupelo/client/reader.rb', line 132

def toggle
  @client.worker << self
end

#waitObject



128
129
130
# File 'lib/tupelo/client/reader.rb', line 128

def wait
  queue.pop
end