Sha256: 33b26c4de6f98fc37603c3edc91f40c7e973ff26930ddd79799d6005877d408d
Contents?: true
Size: 659 Bytes
Versions: 21
Compression:
Stored size: 659 Bytes
Contents
module Eventsimple class Dispatcher def self.on(*events, sync: [], async: []) # Register Reactors to Events. # * Reactors registered with `sync` will be synced synchronously # * Reactors registered with `async` will be synced asynchronously via a Sidekiq Job # # Example: # # on BaseEvent, sync: LogEvent, async: TrackEvent # on PledgeCancelled, PaymentFailed, async: [NotifyAdmin, CreateTask] # on [PledgeCancelled, PaymentFailed], async: [NotifyAdmin, CreateTask] # EventDispatcher.rules.register(events: events.flatten, sync: Array(sync), async: Array(async)) end end end
Version data entries
21 entries across 21 versions & 1 rubygems