Class: Goru::Routines::Channel
- Inherits:
-
Goru::Routine
- Object
- Goru::Routine
- Goru::Routines::Channel
- Defined in:
- lib/goru/routines/channel.rb
Overview
- public
Direct Known Subclasses
Goru::Routines::Channels::Readable, Goru::Routines::Channels::Writable
Constant Summary
Constants inherited from Goru::Routine
Goru::Routine::STATUS_ERRORED, Goru::Routine::STATUS_FINISHED, Goru::Routine::STATUS_IDLE, Goru::Routine::STATUS_PAUSED, Goru::Routine::STATUS_READY
Instance Attribute Summary
Attributes inherited from Goru::Routine
#debug, #error, #reactor, #state, #status
Instance Method Summary collapse
- #channel_closed ⇒ Object
- #channel_read ⇒ Object
- #channel_received ⇒ Object
-
#initialize(state = nil, channel:, &block) ⇒ Channel
constructor
A new instance of Channel.
Methods inherited from Goru::Routine
#add_observer, #adopted, #call, #finished, #finished?, #pause, #ready?, #remove_observer, #result, #resume, #sleep, #update
Constructor Details
#initialize(state = nil, channel:, &block) ⇒ Channel
Returns a new instance of Channel.
10 11 12 13 14 15 16 |
# File 'lib/goru/routines/channel.rb', line 10 def initialize(state = nil, channel:, &block) super(state, &block) @channel = channel @channel.add_observer(self) update_status end |
Instance Method Details
#channel_closed ⇒ Object
37 38 39 |
# File 'lib/goru/routines/channel.rb', line 37 def channel_closed update_status end |
#channel_read ⇒ Object
33 34 35 |
# File 'lib/goru/routines/channel.rb', line 33 def channel_read update_status end |
#channel_received ⇒ Object
29 30 31 |
# File 'lib/goru/routines/channel.rb', line 29 def channel_received update_status end |