Class: Goru::Routines::Channel
Overview
Instance Attribute Summary
#state, #status
Instance Method Summary
collapse
#call, #finished, #reactor=, #result, #sleep, #update, #wake
Constructor Details
#initialize(state = nil, channel:, &block) ⇒ Channel
Returns a new instance of Channel.
10
11
12
13
14
15
|
# File 'lib/goru/routines/channel.rb', line 10
def initialize(state = nil, channel:, &block)
super(state, &block)
@channel = channel
@channel.add_observer(self)
end
|
Instance Method Details
#channel_closed ⇒ Object
36
37
38
|
# File 'lib/goru/routines/channel.rb', line 36
def channel_closed
update_status
end
|
#channel_read ⇒ Object
32
33
34
|
# File 'lib/goru/routines/channel.rb', line 32
def channel_read
update_status
end
|
#channel_received ⇒ Object
28
29
30
|
# File 'lib/goru/routines/channel.rb', line 28
def channel_received
update_status
end
|
#channel_reopened ⇒ Object
40
41
42
|
# File 'lib/goru/routines/channel.rb', line 40
def channel_reopened
update_status
end
|