#future #executor #execute #context #block #block-on #completion

its_ok_to_be_block_on

A minimal implementation of block_on, to execute futures in a syncronous context

1 unstable release

0.1.0 Feb 6, 2024

#1924 in Asynchronous

MIT/Apache

8KB
94 lines

It's ok to be block_on

Sometimes you just need block_on, without an entire bloated futures runtime.

It's ok.

This crate copies and exports the per-thread block_on implementation (and license) from the futures package, minimizing the size of the code and the dependency tree, allowing users to block on the completion of a future in a syncronous context without needing to create and manage an executor.

Does it work?

It compiles. ¯\(ツ)

Dependencies

~27KB