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.Documentation Index
Fetch the complete documentation index at: https://docs.threadify.dev/llms.txt
Use this file to discover all available pages before exploring further.
Contract vs Non-Contract
Contract-based threads end automatically when a terminal step is reached. Non-contract threads require manual ending viacomplete() or cancel().
Basic Usage
Properties
- JavaScript
- Go
- Python
| Method | Description | Parameters |
|---|---|---|
complete(reason?) | Mark thread as successfully completed | reason (string/object, optional) |
cancel(reason?) | Mark thread as cancelled | reason (string/object, optional) |
Notifications
When a thread ends, Threadify emits events:thread.completed- Triggered whencomplete()is called or a terminal step is reachedthread.cancelled- Triggered whencancel()is called
Next Steps
Working with Contracts
Learn how contracts enforce terminal steps
Notifications
Subscribe to thread completion events