Class: RightSpeed::Worker::Fair
- Inherits:
-
Base
- Object
- Base
- RightSpeed::Worker::Fair
show all
- Defined in:
- lib/right_speed/worker/fair.rb
Instance Attribute Summary
Attributes inherited from Base
#ractor
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #stop
Instance Method Details
#process(conn) ⇒ Object
25
26
27
|
# File 'lib/right_speed/worker/fair.rb', line 25
def process(conn)
raise "BUG: Worker::Fair#process should never be called"
end
|
#run(listener_ractor) ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/right_speed/worker/fair.rb', line 7
def run(listener_ractor)
@ractor = Ractor.new(@id, @handler, listener_ractor) do |id, handler, listener|
logger = RightSpeed.logger
while conn = listener.take
begin
handler.session(conn).process
Ractor.yield(conn, move: true) rescue => e
logger.error { "Unexpected error: #{e.message}\n" + e.backtrace.map{"\t#{_1}\n"}.join }
end
end
logger.info { "Worker#{id}: Finishing the Ractor" }
Ractor.yield(:closing) end
end
|
#wait ⇒ Object
29
30
31
32
|
# File 'lib/right_speed/worker/fair.rb', line 29
def wait
end
|