Ravn::Net::Broker::
Promises
module
Adds concurrency futures/promises API
Inclusion hook – log the addition of promises.
def self::prepended( mod )
Ravn::Net::Broker.log.debug "adding promises functionality to brokers"
super
end
future_event( event_type )
Returns a Future that will resolve when the first event matching the specification is received.
def future_event( event_type )
future = Concurrent::Promises.resolvable_future
self.once( event_type, &future.method(:fulfill) )
return future
end