# How to stop a process started with \`@spawnat :any\`

**URL:** https://discourse.julialang.org/t/how-to-stop-a-process-started-with-spawnat-any/64023
**Category:** New to Julia
**Tags:** parallel
**Created:** [July 4, 2021, 7:28am UTC](https://discourse.julialang.org/t/how-to-stop-a-process-started-with-spawnat-any/64023 "2021-07-04T07:28:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![AtsushiSakai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/atsushisakai/32/6559_2.png) [@AtsushiSakai](https://discourse.julialang.org/u/AtsushiSakai)
#### Post date: [July 4, 2021, 7:28am UTC](https://discourse.julialang.org/t/how-to-stop-a-process-started-with-spawnat-any/64023/1 "2021-07-04T07:28:28Z")

</div>

Suppose I start a parallel task with:  
`future = @spawnat :any do_very_long_time_process()`  
How can I stop the process using the `future`?

There is [Distributed.interrupt](https://docs.julialang.org/en/v1/stdlib/Distributed/#Distributed.interrupt), but it needs `pid`.  
In other words, how can I get `pid` from a `future`?

Related questions:

- [How to stop a task started with `@schedule` - Usage / First steps - JuliaLang](https://discourse.julialang.org/t/how-to-stop-a-task-started-with-schedule/7632)
- [Stop/terminate a (sub)task started with @async - Usage - JuliaLang](https://discourse.julialang.org/t/stop-terminate-a-sub-task-started-with-async/32193)

But these are for `Task`, not `Future`.

---

<div class="post-metadata">

### Author: ![findmyway](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/findmyway/32/4946_2.png) [@findmyway](https://discourse.julialang.org/u/findmyway)
#### Post date: [July 4, 2021, 8:13am UTC](https://discourse.julialang.org/t/how-to-stop-a-process-started-with-spawnat-any/64023/2 "2021-07-04T08:13:43Z")

</div>

`Future` has a `where` field.

```julia
* `where` - refers to the node where the underlying object/storage
  referred to by the reference actually exists.

```

---

<div class="post-metadata">

### Author: ![AtsushiSakai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/atsushisakai/32/6559_2.png) [@AtsushiSakai](https://discourse.julialang.org/u/AtsushiSakai)
#### Post date: [July 5, 2021, 12:04pm UTC](https://discourse.julialang.org/t/how-to-stop-a-process-started-with-spawnat-any/64023/3 "2021-07-05T12:04:49Z")

</div>

Oh. Thanks. This code works:

```julia
interrupt(future.where)

```
