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
It can be a bit tricky keeping everything alive in an async context. This is an umbrella issue for discussion and brainstorming of ideas.
For example, a nursery blocks until all underlying tasks have finished. This allows things defined at the top level of the nursery to be global state shared by reference across all tasks.
A common approach in use right now is to wrap state in a shared pointer and pass that state by copy to all callbacks but this might involve a lot of shared pointer copies.
Another approach could be to define a method like Future<T> AsyncBind(function<Future<T>(S\*)>>, shared_ptr<S>) which guarantees the S* is valid until the future completes.
Those approaches also might help futures but then not be able to help async generators, especially if that generator is passed back to user code. In that case it might be helpful to have something like...
It can be a bit tricky keeping everything alive in an async context. This is an umbrella issue for discussion and brainstorming of ideas.
For example, a nursery blocks until all underlying tasks have finished. This allows things defined at the top level of the nursery to be global state shared by reference across all tasks.
A common approach in use right now is to wrap state in a shared pointer and pass that state by copy to all callbacks but this might involve a lot of shared pointer copies.
Another approach could be to define a method like
Future<T> AsyncBind(function<Future<T>(S\*)>>, shared_ptr<S>)
which guarantees the S* is valid until the future completes.Those approaches also might help futures but then not be able to help async generators, especially if that generator is passed back to user code. In that case it might be helpful to have something like...
AsyncGenerator AddFinallyCallback(AsyncGenerator, function<void()>)
...or...
AsyncGenerator BindToGenerator(function<AsyncGenerator(S*)>, std::shared_ptr
)Reporter: Weston Pace / @westonpace
Note: This issue was originally created as ARROW-12285. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: