The components are accessed by a lock on application state. When some command calls block_on to enter an async context, it obtained a write lock on the entire application state. This meant that if the application state were accessed later in an async context, a deadlock would occur. Instead the TokioComponent holds an Option<Runtime> now, so that before calling block_on, the caller can .take() the runtime and release the lock. Since we only ever enter an async context once, it's not a problem that the component is then missing its runtime, as once we are inside of a task we can access the runtime. |
||
|---|---|---|
| .. | ||
| config.rs | ||
| connect.rs | ||
| seed.rs | ||
| start.rs | ||
| version.rs | ||