# SE-0526: withDeadline

**URL:** <https://forums.swift.org/t/se-0526-withdeadline/85850>\
**Category:** Proposal Reviews\
**Created:** [April 7, 2026, 1:34am UTC](https://forums.swift.org/t/se-0526-withdeadline/85850 "2026-04-07T01:34:31Z")\
**Posts on this page:** 1\
**Showing post:** 26

<div class="post-metadata">

**Author:** ![FranzBusch](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/franzbusch/32/19447_2.png) [@FranzBusch](https://forums.swift.org/u/FranzBusch)\
**Post date:** [April 13, 2026, 12:19pm UTC](https://forums.swift.org/t/se-0526-withdeadline/85850/26 "2026-04-13T12:19:02Z")

</div>

I want to address a question that was brought to me in offline discussions around this proposal. A previous version contained the implementation of the proposed `withDeadline` method, which showed that it is based around two child tasks that are racing with each other. While this is the current implementation and the simplest way to get the semantics to work, this might not be the long-term implementation. In particular, spawning two child tasks can be quite expensive, and underlying executors might be able to handle this better directly. Similar to the APIs proposed in [SE-0505: Delayed Enqueuing for Executors](https://forums.swift.org/t/se-0505-delayed-enqueuing-for-executors/84157), we can expand the APIs of jobs and executors to avoid spawning any child tasks. Importantly, this can be done in a future evolution.

---

_[View the full topic](https://forums.swift.org/t/se-0526-withdeadline/85850)._
