# block_on

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

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

```rust
fn block_on<T: Clone + 'static>(future: impl Future<Output = Result<T, crate::ObservableError>> + 'static) -> Result<T, crate::ObservableError>
```

Runs `future` on the current thread until it ends, waiting for wakes from other threads in
between (a thread with nothing else to run: a console program, a test)
([`crate::task::block_on`](/docs/0.5.0/api/ferroui-system/task/function-block_on/)).
## Panics
With the panic of the future. Never returns when nothing wakes the future again: a future that
waits for this thread itself (a scheduler of the thread, a task that only this thread ends) has
to be ended by something that runs before it waits.

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

> **Deprecated since 0.5.0.** use `ferroui_system::task::block_on`, which takes any future

## Availability

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