# spawn_local

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-system/threading/tasks/function-spawn_local/

**function** · [`ferroui-system`](/docs/0.5.0/api/ferroui-system/) · v0.5.0

```rust
fn spawn_local<T: 'static>(future: impl Future<Output = Result<T, crate::ObservableError>> + 'static) -> super::task::Task<T>
```

Runs `future` on the current thread and gives its task: the output of the future ends it, an
error that is a cancellation ([`Canceled`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-canceled/), `TaskCanceledError`)
cancels it, and a panic faults it with a [`TaskWorkError`](/docs/0.5.0/api/ferroui-system/threading/tasks/struct-taskworkerror/). The future is polled at once, and
again whenever it is woken (the module's documentation).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.System/threading/tasks/local_executor.rs#L52)

> **Deprecated since 0.5.0.** use `ferroui_system::task::spawn_local`, which gives a `JoinHandle` (`.shared()` for several observers)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
