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 Method Summary
collapse
#__mycel_callback_handlers__, #callback, #on
Methods inherited from Context
#wait
Constructor Details
#initialize(session) ⇒ Command
Returns a new instance of Command.
412
413
414
415
|
# File 'lib/mycel.rb', line 412
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
438
439
440
441
442
443
444
|
# File 'lib/mycel.rb', line 438
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
446
447
448
449
450
|
# File 'lib/mycel.rb', line 446
def they_progress(payload)
guard_assert_state(STATE_RUNNING) {
callback(:progress, payload)
}
end
|
#they_respond(payload) ⇒ Object
430
431
432
433
434
435
436
|
# File 'lib/mycel.rb', line 430
def they_respond(payload)
guard_assert_state(STATE_RUNNING) {
callback(:response, payload)
@session.unregister_id(DIR_COMMAND, @id)
change_state(STATE_STOPPED)
}
end
|