# Stop/terminate a (sub)task started with @async

**URL:** https://discourse.julialang.org/t/stop-terminate-a-sub-task-started-with-async/32193
**Category:** General Usage
**Tags:** question, task
**Created:** [December 12, 2019, 12:29pm UTC](https://discourse.julialang.org/t/stop-terminate-a-sub-task-started-with-async/32193 "2019-12-12T12:29:07Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![jameson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jameson/32/23_2.png) [@jameson](https://discourse.julialang.org/u/jameson)
#### Post date: [December 15, 2019, 3:34am UTC](https://discourse.julialang.org/t/stop-terminate-a-sub-task-started-with-async/32193/5 "2019-12-15T03:34:26Z")

</div>

Yes, that might work sometimes, but you’re messing with the internal state of the scheduler, so it’s not really safe. But you’re just controlling the wrong object: `sleep` is just a thin wrapper around `Timer` and the `Timer` object does support start and stop (actually it maybe just exports the `new` and `close` actions right now, but it could export the `start` and `stop` names too).

---

_[View the full topic](https://discourse.julialang.org/t/stop-terminate-a-sub-task-started-with-async/32193)._
