-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
Our various runtime agnostic blocking functions are a bit jumbled.
- `block_on` is intended to be called from synchronous contexts only and is basically used as the bridge from the sync -> async world (tokio docs). Ironically our documentation states that our version of the method will panic if it's called from a synchronous context on tokio. This is never tripped since we use async-std for the sync driver anyways.
- `block_in_place` (in the tokio definition) is meant to called from async contexts and it basically allows you to do blocking work without blocking the entire runtime. Our implementation is kind of like `block_on` in that it blocks on a future but different in that it can be called from async contexts since it just uses the current thread rather than getting one from the runtime. The key danger is that it doesn't notify the runtime that it's doing so and could potentially block it.
We should update them to match their usage in the underlying async runtimes.