Ruby AsyncEmitter Class

Abstract

Link to the generated yard docs

This is available as a gem as async_emitter.

AsyncEmitter

Sample Usage

       emitter = AsyncEmitter.new
       emitter.on :error, lambda { |e| puts "Error: #{e}" }
       emitter.on :data, lambda { |data| puts "Data: #{data}" }

       begin
               data = get_data_from_somewhere
               emitter.emit :data, data
       rescue Exception => e
               emitter.emit :error, e
       end