Skip to content
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

Allow oneshot::Receiver::close after successful try_recv #3552

Merged
merged 1 commit into from
Feb 25, 2021

Commits on Feb 25, 2021

  1. Allow oneshot::Receiver::close after successful try_recv

    Before this commit `close` after successful `try_recv` panics.
    
    My use case is this: on drop, I call `close` to prevent pushing a
    message to the queue, and then fetch the message if any and process
    it.
    
    But if message is already processed, `close` panics.  And there is
    no API to know if message was already fetched or not (except for
    writing a wrapped which would track that info, which would be an
    overkill).
    
    But generally `close` operation should be safe to be called any
    time.
    stepancheg committed Feb 25, 2021
    Configuration menu
    Copy the full SHA
    b0f8283 View commit details
    Browse the repository at this point in the history