Class: Mycel::Channel::Command
Constant Summary
Constants inherited
from Context
Mycel::Channel::Context::STATE_INIT, Mycel::Channel::Context::STATE_RUNNING, Mycel::Channel::Context::STATE_STOPPED
Instance Attribute Summary
Attributes inherited from Context
#session
Instance Method Summary
collapse
#__mycel_callback_handlers__, #callback, #on
Methods inherited from Context
#wait
Constructor Details
#initialize(session) ⇒ Command
Returns a new instance of Command.
450
451
452
453
|
# File 'lib/mycel.rb', line 450
def initialize(session)
super
@id = @session.generate_and_register_out_id(self)
end
|
Instance Method Details
#advise(payload) ⇒ Object
#request(payload) ⇒ Object
#they_abort ⇒ Object
476
477
478
479
480
481
482
|
# File 'lib/mycel.rb', line 476
def they_abort
guard_assert_state(STATE_RUNNING) {
callback(:abort)
@session.unregister_id(DIR_COMMAND, @id)
change_state(STATE_STOPPED)
}
end
|
#they_progress(payload) ⇒ Object
484
485
486
487
488
|
# File 'lib/mycel.rb', line 484
def they_progress(payload)
guard_assert_state(STATE_RUNNING) {
callback(:progress, payload)
}
end
|
#they_respond(payload) ⇒ Object
468
469
470
471
472
473
474
|
# File 'lib/mycel.rb', line 468
def they_respond(payload)
guard_assert_state(STATE_RUNNING) {
callback(:response, payload)
@session.unregister_id(DIR_COMMAND, @id)
change_state(STATE_STOPPED)
}
end
|