-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add _PyOnceFlag_CallOnceTimed
#115229
Comments
@colesbury - I wanted to get your take on this. Happy to implement if you think it's worth having. |
I think we should be able to get away with
|
I might be misunderstanding, but I think that only works if we allow It sounds like there probably isn't enough justification for this, though, so I can just implement support directly in |
I think the implementation would be simpler if we don't expose If we continue to expose |
Makes sense to me. I wasn't sure why it was there either. It looks like it's only used in |
Feature or enhancement
Proposal:
We may want to call a function once, but only wait for a given amount of time for the function to be called. For example, to extend the
join
operation in #115190 with atimeout
argument, we need to be able to bound the amount of time we wait for the join operation to be called (in addition to how long the join takes once it's been called).It seems like the natural place for such logic to live is in
_PyOnceFlag
, otherwise we would need to duplicate the_PyOnceFlag
functionality and extend it to support timeouts. That said, I'm not sure how widely applicable this will be, so it may make sense to just duplicate the logic. Assuming we want to support such a use case, I propose adding_PyOnceFlag_CallOnceTimed
with the following semantics:Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
The text was updated successfully, but these errors were encountered: