Method: MessageBus::Implementation#subscribe
- Defined in:
- lib/message_bus.rb
#subscribe(channel = nil, last_id = -1,) {|message| ... } ⇒ Proc
Subscribe to messages on a particular channel. Each message since the last ID specified will be delivered by yielding to the passed block as soon as it is available. This will not block, but instead the callbacks will be executed asynchronously in a dedicated subscriber thread.
426 427 428 |
# File 'lib/message_bus.rb', line 426 def subscribe(channel = nil, last_id = -1, &blk) subscribe_impl(channel, nil, last_id, &blk) end |