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

opt. timeouts for Queue.put() and .get() #36787

Closed
cliechti mannequin opened this issue Jun 23, 2002 · 4 comments
Closed

opt. timeouts for Queue.put() and .get() #36787

cliechti mannequin opened this issue Jun 23, 2002 · 4 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@cliechti
Copy link
Mannequin

cliechti mannequin commented Jun 23, 2002

BPO 572628
Nosy @loewis
Files
  • queue.patch: two patches for Queue.py and test/test_queue.py merged in one file
  • libqueue.diff: patch for the docs (libqueue.tex)
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/loewis'
    closed_at = <Date 2002-10-15.15:12:12.000>
    created_at = <Date 2002-06-23.00:37:32.000>
    labels = ['library']
    title = 'opt. timeouts for Queue.put() and .get()'
    updated_at = <Date 2002-10-15.15:12:12.000>
    user = 'https://bugs.python.org/cliechti'

    bugs.python.org fields:

    activity = <Date 2002-10-15.15:12:12.000>
    actor = 'loewis'
    assignee = 'loewis'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2002-06-23.00:37:32.000>
    creator = 'cliechti'
    dependencies = []
    files = ['4368', '4369']
    hgrepos = []
    issue_num = 572628
    keywords = ['patch']
    message_count = 4.0
    messages = ['40390', '40391', '40392', '40393']
    nosy_count = 2.0
    nosy_names = ['loewis', 'cliechti']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue572628'
    versions = ['Python 2.3']

    @cliechti
    Copy link
    Mannequin Author

    cliechti mannequin commented Jun 23, 2002

    Sometimes one wants a Queue that doesn't block forever on a get()
    or put(). Both should be able to return after a certain time, acting like
    they were called non-blocking and failed. i.e get() raises the Empty
    exception when it times out, put() raises Full.

    This patch
    adds optional timeout arguments to these methods.
    The old
    'block' arg is left and behaves 100% like in the old days (backwards
    compatibility). The new feature appears only when 'block' is true
    and 'timeout' is a positive number.

    The new code is basicaly
    a merge between the original Queue.py's put() and get() and
    threading.py's
    _Event.wait() --- code that's proven to work,
    nothing realy new here.

    I also added some simple tests to
    the test_queue.py script for the new feature.

    @cliechti cliechti mannequin closed this as completed Jun 23, 2002
    @cliechti cliechti mannequin assigned loewis Jun 23, 2002
    @cliechti cliechti mannequin added the stdlib Python modules in the Lib dir label Jun 23, 2002
    @cliechti cliechti mannequin closed this as completed Jun 23, 2002
    @cliechti cliechti mannequin assigned loewis Jun 23, 2002
    @cliechti cliechti mannequin added the stdlib Python modules in the Lib dir label Jun 23, 2002
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Oct 13, 2002

    Logged In: YES
    user_id=21627

    Can you please provide documentation changes (for
    libqueue.tex) as well?

    @cliechti
    Copy link
    Mannequin Author

    cliechti mannequin commented Oct 13, 2002

    Logged In: YES
    user_id=403744

    Here's the patch for the docs. I also updated the references to 0/1 to
    False/True in the other method descriptions.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Oct 15, 2002

    Logged In: YES
    user_id=21627

    Thanks for the patch. Applied as

    Queue.py 1.17;
    test_queue.py 1.3;
    libqueue.tex 1.13;
    NEWS 1.501;

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants