Chimeway.Dispatch.SignalRouterWorker (chimeway v1.0.0)

Copy Markdown View Source

Oban worker that routes an incoming signal to all waiting workflow runs that are suspended on the signal's event_name within the same tenant.

Job args contain only signal_id. The worker:

  1. Fetches the Chimeway.Signals.Signal row by ID.
  2. Delegates to Chimeway.Workflows.route_signal/1, which atomically resumes every matching WorkflowRun and appends a WorkflowTransition trace.

Returns :ok on success (including when zero workflows match) so Oban marks the job :completed. Returns {:error, :signal_not_found} when the signal row no longer exists; Oban will schedule a retry.