mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-04 06:01:23 +09:00
WorkflowEventBus.emit no longer spawns a per-event daemon thread to match + trigger workflows. It now enqueues a single 'workflow.dispatch' job; the new WorkflowEventBus.dispatch_event handler does the matching (active event-trigger workflows whose eventType matches, honoring the 60s cooldown) and enqueues a workflow.execute job per match. emit is a non-blocking enqueue, best-effort (never raises into the caller), and the whole event -> dispatch -> execute path now flows through the bus (observable, persistent across restart). Removes the last ad-hoc thread on the workflow path. Registered alongside workflow.execute in WorkflowEngine.register_jobs. tests: dispatch handler registered; emit enqueues a dispatch job (not a thread); dispatch fans out only to the matching event workflow. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>