# block_on

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

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

```rust
fn block_on<F>(future: F) -> <F as >::Output
where F: Future + 'static,
      <F as >::Output: 'static
```

Runs `future` on the current thread until it ends, and gives its output: it is spawned in the
queue of the thread ([`spawn_local`](/docs/0.5.0/api/ferroui-system/task/function-spawn_local/)), and the thread waits for wakes from other threads in
between (a thread with nothing else to run: a console program, a test, a worker). While it
runs, no schedule is current ([`current_schedule`](/docs/0.5.0/api/ferroui-system/task/function-current_schedule/)), so the tasks that its future spawns are in
the queue of the thread too, which this waits on.
## Panics
With the panic of the future. Never returns when nothing wakes the future again: a future that
waits for this thread itself (work queued on a schedule of the thread) has to be ended by
something that runs before it waits.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.System/task/executor.rs#L661)

## Availability

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