Class: Citrus::Components::Server
- Defined in:
- lib/citrus/components/server.rb
Overview
Server
Instance Method Summary collapse
-
#after_start(&block) ⇒ Object
Component lifecycle callback.
-
#global_handle(msg, session, &block) ⇒ Object
Proxy server global handle.
-
#handle(msg, session, &block) ⇒ Object
Proxy server handle.
-
#initialize(app) ⇒ Server
constructor
Initialize the component.
-
#start(&block) ⇒ Object
Start the component.
-
#stop(force = false, &block) ⇒ Object
Stop the component.
Constructor Details
Instance Method Details
#after_start(&block) ⇒ Object
Component lifecycle callback
33 34 35 36 |
# File 'lib/citrus/components/server.rb', line 33 def after_start &block @server.after_start EM.next_tick { block_given? and yield } end |
#global_handle(msg, session, &block) ⇒ Object
Proxy server global handle
56 57 58 |
# File 'lib/citrus/components/server.rb', line 56 def global_handle msg, session, &block @server.global_handle msg, session, &block end |
#handle(msg, session, &block) ⇒ Object
Proxy server handle
48 49 50 |
# File 'lib/citrus/components/server.rb', line 48 def handle msg, session, &block @server.handle msg, session, &block end |
#start(&block) ⇒ Object
Start the component
27 28 29 30 |
# File 'lib/citrus/components/server.rb', line 27 def start &block @server.start EM.next_tick { block_given? and yield } end |
#stop(force = false, &block) ⇒ Object
Stop the component
39 40 41 42 |
# File 'lib/citrus/components/server.rb', line 39 def stop force=false, &block @server.stop EM.next_tick { block_given? and yield } end |