Module: EventRouter

Defined in:
lib/event_router.rb,
lib/event_router/error.rb,
lib/event_router/event.rb,
lib/event_router/version.rb,
lib/event_router/publisher.rb,
lib/event_router/serializer.rb,
lib/event_router/destination.rb,
lib/event_router/configuration.rb,
lib/event_router/helpers/event.rb,
lib/event_router/serializers/oj.rb,
lib/event_router/serializers/base.rb,
lib/event_router/serializers/json.rb,
lib/event_router/delivery_adapters/base.rb,
lib/event_router/delivery_adapters/sync.rb,
lib/event_router/delivery_adapters/sidekiq.rb,
lib/event_router/errors/required_option_error.rb,
lib/event_router/errors/unsupported_option_error.rb,
lib/event_router/delivery_adapters/helpers/sidekiq.rb,
lib/event_router/delivery_adapters/workers/sidekiq_event_delivery_worker.rb,
lib/event_router/delivery_adapters/workers/sidekiq_destination_delivery_worker.rb

Defined Under Namespace

Modules: DeliveryAdapters, Errors, Helpers, Publisher, Serializer, Serializers Classes: Configuration, Destination, Error, Event

Constant Summary collapse

VERSION =
'0.3.0'

Class Method Summary collapse

Class Method Details

.configurationObject



32
33
34
# File 'lib/event_router.rb', line 32

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



36
37
38
# File 'lib/event_router.rb', line 36

def configure
  yield configuration if block_given?
end

.deserialize(payload, adapter: EventRouter.configuration.serializer_adapter) ⇒ Object



28
29
30
# File 'lib/event_router.rb', line 28

def deserialize(payload, adapter: EventRouter.configuration.serializer_adapter)
  EventRouter::Serializer.deserialize(payload, adapter: adapter)
end

.publish(events, adapter: EventRouter.configuration.delivery_adapter) ⇒ Object



16
17
18
# File 'lib/event_router.rb', line 16

def publish(events, adapter: EventRouter.configuration.delivery_adapter)
  EventRouter::Publisher.publish(events, adapter: adapter)
end

.publish_async(events, adapter: EventRouter.configuration.delivery_adapter) ⇒ Object



20
21
22
# File 'lib/event_router.rb', line 20

def publish_async(events, adapter: EventRouter.configuration.delivery_adapter)
  EventRouter::Publisher.publish_async(events, adapter: adapter)
end

.serialize(event, adapter: EventRouter.configuration.serializer_adapter) ⇒ Object



24
25
26
# File 'lib/event_router.rb', line 24

def serialize(event, adapter: EventRouter.configuration.serializer_adapter)
  EventRouter::Serializer.serialize(event, adapter: adapter)
end