Class: Citrus::PushSchedulers::Direct
- Inherits:
-
Object
- Object
- Citrus::PushSchedulers::Direct
- Defined in:
- lib/citrus/push_schedulers/direct.rb
Overview
Direct
Instance Method Summary collapse
-
#initialize(app, args) ⇒ Direct
constructor
Initialize the component.
-
#schedule(req_id, route, msg, recvs, args, &block) ⇒ Object
Schedule.
Constructor Details
#initialize(app, args) ⇒ Direct
Initialize the component
18 19 20 |
# File 'lib/citrus/push_schedulers/direct.rb', line 18 def initialize app, args @app = app end |
Instance Method Details
#schedule(req_id, route, msg, recvs, args, &block) ⇒ Object
Schedule
29 30 31 32 33 34 35 36 37 |
# File 'lib/citrus/push_schedulers/direct.rb', line 29 def schedule req_id, route, msg, recvs, args, &block if args[:type] == 'broadcast' do_broadcast msg, args[:user_args] else do_batch_push msg, recvs end EM.next_tick { block.call } if block_given? end |