ActionCable background processing

Context: I’m creating a gem for collaborative editing with ActionCable & ProseMirror. My solution involves spawning a pool of NodeJS child processes for applying operational transforms to documents.

Is the threadpool built into ActionCable built to handle long-running actions (20-50ms) or should those be processed in background jobs?

You should use ActiveJob (and ideally Sidekiq) to manage those jobs.

When the jobs complete, you can use the broadcast_to method of CableReady to notify your clients of new updates.