Module: KafkaRest::EventEmitter
- Included in:
- ConsumerStream
- Defined in:
- lib/kafka_rest/event_emitter.rb
Instance Method Summary collapse
Instance Method Details
#emit(type, *args) ⇒ Object
8 9 10 |
# File 'lib/kafka_rest/event_emitter.rb', line 8 def emit(type, *args) callbacks[type].each { |block| block.call(*args) } end |
#on(type, &block) ⇒ Object
3 4 5 6 |
# File 'lib/kafka_rest/event_emitter.rb', line 3 def on(type, &block) callbacks[type] << block self end |