Home / Companies / Temporal / Blog / Post Details
Content Deep Dive

Timers, Timeouts, and the Art of Waiting in Temporal

Blog post from Temporal

Post Details
Company
Date Published
Author
Mason Egger, Joshua Smith
Word Count
3,172
Company Posts That Month
17
Language
English
Hacker News Points
-
Summary

Temporal, a platform for building durable and scalable workflows, presents developers with a crucial decision between using timers and timeouts, which can significantly impact the robustness of their applications. Timers in Temporal are designed to implement business logic, allowing workflows to wait and then execute specific actions, while timeouts are meant to detect failures by bounding the duration of operations. Temporal's timers are durable, enabling workflows to continue from where they left off even if a worker goes down, thus supporting massive concurrency with minimal resource consumption. Conversely, timeouts are critical for managing activity failures, offering settings like Start-To-Close, Schedule-To-Close, Schedule-To-Start, and Heartbeat timeouts, each serving different purposes in failure detection and management. The article emphasizes that using workflow-level timeouts for business logic can lead to issues, as these are enforced server-side without notifying the workflow code, thereby potentially terminating executions abruptly. Instead, developers are encouraged to use timers within workflows to handle business logic, ensuring that the workflows can respond appropriately to time-limit conditions. The distinction between timers and timeouts is vital for developers to understand in order to harness Temporal's powerful time-management capabilities effectively and avoid common pitfalls.

Trends Found in this Post

No tracked trend matches for this post yet.