Break API calls in work towards moving all blocking io to ractors, dropped BackgroundWorker class

This commit is contained in:
2026-01-30 19:36:11 -06:00
parent 6e79c4639d
commit f98d8c3394
7 changed files with 134 additions and 207 deletions

View File

@@ -682,7 +682,23 @@ class W3DHub
# mark MAIN ractor's task as started before handing off to background ractor
# so that we don't start up multiple tasks at once.
task.start
BackgroundWorker.ractor_task(task)
on_ractor(task)
end
def on_ractor(task)
raise "Something has gone horribly wrong!!!" unless Ractor.main?
ractor = Ractor.new(task) do |t|
t.start
end
Thread.new do
while (message_event = ractor.take)
break unless message_event.is_a?(Task::MessageEvent)
Store.application_manager.handle_task_event(message_event)
end
end
end
def task?(type, app_id, channel)