Module: CanvasSync::LiveEvents
- Defined in:
- lib/canvas_sync/live_events.rb,
lib/canvas_sync/live_events/base_handler.rb,
lib/canvas_sync/live_events/process_event_job.rb
Defined Under Namespace
Classes: BaseHandler, ProcessEventJob, RetryLiveEventJob
Constant Summary
collapse
- @@registered_handlers =
[]
Class Method Summary
collapse
Class Method Details
.listen(event_types = nil, &blk) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/canvas_sync/live_events.rb', line 10
def listen(event_types = nil, &blk)
if event_types != nil
blk = wrap_method(blk) do |inner, event|
meta = event[:metadata]
payload = event[:payload]
if event_types.include?(meta[:event_name])
inner.call(*args)
end
end
end
@@registered_handlers << blk
end
|
.registered_handlers ⇒ Object
25
26
27
|
# File 'lib/canvas_sync/live_events.rb', line 25
def registered_handlers
@@registered_handlers
end
|