Module: EventStream::SubscriberDSL

Extended by:
ActiveSupport::Concern
Defined in:
lib/event_stream/subscriber_dsl.rb

Overview

Provides a DSL with which to create Subscribers. For example:

class MySubscriber
  include EventStream::SubscriberDSL

  # Which event_stream to use. If not specified, the default will be used.
  event_stream EventStream.default_stream

  # Sets up a subscriber using a block
  on(:my_other_event) { |event| puts event.name }
end

Note that this does NOT register subscribers. To register subscribers, call:

MySubscriber.subscribe

This registers all subscribers to the provided event_stream (or to the default).

Defined Under Namespace

Modules: ClassMethods