Module: FastlyNsq::ListenerTesting::ClassMethods
- Defined in:
- lib/fastly_nsq/testing.rb
Instance Method Summary collapse
Instance Method Details
#clear ⇒ Object
214 215 216 |
# File 'lib/fastly_nsq/testing.rb', line 214 def clear FastlyNsq::Messages..clear end |
#drain(topic = nil) ⇒ Object
202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/fastly_nsq/testing.rb', line 202 def drain(topic = nil) topics = topic ? [topic] : FastlyNsq::Messages..keys topics.each do |t| = FastlyNsq::Messages.[t] next unless .any? listener = FastlyNsq.manager.topic_listeners[t] next unless listener .dup.each { || listener.call() } end end |
#messages(topic = nil) ⇒ Object
196 197 198 199 200 |
# File 'lib/fastly_nsq/testing.rb', line 196 def (topic = nil) return FastlyNsq::Messages..values.flatten unless topic FastlyNsq::Messages.[topic] end |