You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem description
Right now both the connections to the server and the controller require a Tokio runtime, but it is also needed to spawn background tasks such as in EventStreamWriter. This has had the unfortunate side effect of making methods that don't need to be async into async methods just so they can call spawn: #104 (comment)
Additionally it means that each test must create a Runtime, which leads to redundant setup logic, which we have avoided by combining multiple tests into one.
Suggestions for an improvement
Instead the Runtime should be created and held by ClientFactoryInternal and provide an accessor so that any code in the client can spawn tasks without needing to be async or worry about the context in which it is called. At the same time this should simplify our unit tests.
The text was updated successfully, but these errors were encountered:
Problem description
Right now both the connections to the server and the controller require a Tokio runtime, but it is also needed to spawn background tasks such as in EventStreamWriter. This has had the unfortunate side effect of making methods that don't need to be async into async methods just so they can call
spawn
: #104 (comment)Additionally it means that each test must create a
Runtime
, which leads to redundant setup logic, which we have avoided by combining multiple tests into one.Suggestions for an improvement
Instead the Runtime should be created and held by ClientFactoryInternal and provide an accessor so that any code in the client can spawn tasks without needing to be async or worry about the context in which it is called. At the same time this should simplify our unit tests.
The text was updated successfully, but these errors were encountered: