lib/zapp/worker.rb in zapp-0.2.1 vs lib/zapp/worker.rb in zapp-0.2.2
- old
+ new
@@ -4,22 +4,21 @@
module Zapp
# One worker processing requests in parallel
class Worker < Ractor
class << self
- def new(context_pipe:, socket_pipe:, app:, index:)
+ def new(context_pipe:, socket_pipe:, index:)
super(
context_pipe,
socket_pipe,
- app,
Zapp.config.dup,
name: name(index)
- ) do |context_pipe, socket_pipe, app, config|
+ ) do |context_pipe, socket_pipe, config|
+ Ractor.current[Zapp::RACTOR_CONFIG_KEY] = config
+
processor = Zapp::Worker::RequestProcessor.new(
socket_pipe: socket_pipe,
- context_pipe: context_pipe,
- app: app,
- config: config
+ context_pipe: context_pipe
)
processor.loop
end
end