Class: RightSpeed::Worker::Accepter
- Inherits:
-
Base
- Object
- Base
- RightSpeed::Worker::Accepter
show all
- Defined in:
- lib/right_speed/worker/accepter.rb
Instance Attribute Summary
Attributes inherited from Base
#ractor
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #stop
Instance Method Details
#run(sock) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/right_speed/worker/accepter.rb', line 6
def run(sock)
@ractor = Ractor.new(@id, sock, @handler) do |id, sock, handler|
logger = RightSpeed.logger
while conn = sock.accept
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
24
25
26
27
|
# File 'lib/right_speed/worker/accepter.rb', line 24
def wait
end
|