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
Short description of the feature
Provide a context that postpones exactly once, even when nested. This would allow combining multiple high-level calls as a quasi-atomic async operation.
This is intended as a helper for creating high-level operations. It is required to build new abstractions; users of existing abstractions do not need it.
Describe the solution you'd like
Add an async with context that opens a postponement scope or resumes an outer one. The outermost context will postpone if it is exited at the same time and turn as it was entered. Nested scopes delegate the responsibility to outer scopes.
Postponement is dynamically scoped, meaning that any postponement in an __await__, __aenter__/__aexit__ or __aiter__/__anext__ is considered nested in any outer postponements.
asyncwithpostponed(): # open scopeasyncwithpostponed(): # resume scopeawaitsomething() # resume scope?
Enforcing only postponement, not suspension, is optional.
Describe alternatives and the context you have considered
This has originated from #64. In such a specific case, a special cased implementation could be made. However, these special cases must be carefully constructed to avoid duplicate postponement. Combining several high-level calls is very difficult.
The text was updated successfully, but these errors were encountered:
Short description of the feature
Provide a context that postpones exactly once, even when nested. This would allow combining multiple high-level calls as a quasi-atomic async operation.
This is intended as a helper for creating high-level operations. It is required to build new abstractions; users of existing abstractions do not need it.
Describe the solution you'd like
Add an
async with
context that opens a postponement scope or resumes an outer one. The outermost context will postpone if it is exited at the same time and turn as it was entered. Nested scopes delegate the responsibility to outer scopes.Postponement is dynamically scoped, meaning that any postponement in an
__await__
,__aenter__
/__aexit__
or__aiter__
/__anext__
is considered nested in any outer postponements.Enforcing only postponement, not suspension, is optional.
Describe alternatives and the context you have considered
This has originated from #64. In such a specific case, a special cased implementation could be made. However, these special cases must be carefully constructed to avoid duplicate postponement. Combining several high-level calls is very difficult.
The text was updated successfully, but these errors were encountered: