Skip to main content
Unsubscribe removes event handlers and stops receiving notifications for specific steps or events.
// Unsubscribe from specific step event
threadify.unsubscribe('step.success', 'order_placed');

// Unsubscribe from thread-level event
threadify.unsubscribe('thread.completed');

When to Unsubscribe

ScenarioAction
Cleanup on shutdownUnsubscribe before closing connection
Dynamic subscriptionsRemove handlers no longer needed
Memory managementPrevent handler leaks in long-running processes

Behavior

  • Removes event handler from client
  • Stops receiving notifications for that event/step combination
  • Server stops sending notifications if no active subscriptions remain
  • Safe to call multiple times (idempotent)