Skip to main content
Closing a thread allows you to explicitly mark threads as completed or cancelled. Contract-based threads end automatically at terminal steps, while non-contract threads require manual ending.

Contract vs Non-Contract

Contract-based threads end automatically when a terminal step is reached. Non-contract threads require manual ending via complete() or cancel().
Manual completion is rejected for contract-based threads unless a terminal step has been reached.

Basic Usage

Properties

Notifications

When a thread ends, Threadify emits events:
  • thread.completed - Triggered when complete() is called or a terminal step is reached
  • thread.cancelled - Triggered when cancel() is called

Next Steps

Working with Contracts

Learn how contracts enforce terminal steps

Notifications

Subscribe to thread completion events