Class: Goru::Routines::Bridge
Overview
Instance Attribute Summary
#state, #status
Instance Method Summary
collapse
#call, #finished, #reactor=, #result, #sleep, #update, #wake
Constructor Details
#initialize(state = nil, routine:, channel:, &block) ⇒ Bridge
Returns a new instance of Bridge.
10
11
12
13
14
15
16
|
# File 'lib/goru/routines/bridge.rb', line 10
def initialize(state = nil, routine:, channel:, &block)
super(state, &block)
@routine = routine
@channel = channel
@channel.add_observer(self)
end
|
Instance Method Details
#channel_closed ⇒ Object
41
42
43
|
# File 'lib/goru/routines/bridge.rb', line 41
def channel_closed
update_status
end
|
#channel_read ⇒ Object
37
38
39
|
# File 'lib/goru/routines/bridge.rb', line 37
def channel_read
update_status
end
|
#channel_received ⇒ Object
33
34
35
|
# File 'lib/goru/routines/bridge.rb', line 33
def channel_received
update_status
end
|
#channel_reopened ⇒ Object
45
46
47
|
# File 'lib/goru/routines/bridge.rb', line 45
def channel_reopened
update_status
end
|
#ready? ⇒ Boolean
20
21
22
|
# File 'lib/goru/routines/bridge.rb', line 20
def ready?
@status == :ready
end
|