Skip to content

Final Done Task Repeating #10

Description

@graingerkid

With the following example, if I run it and then comment out the put loop and then run it again, I get 99 printed.

def worker():
    while True:
        try:
            item = q.get()
            print item
        except:
            pass
        finally:
            q.task_done()

for i in range(3):
     t = Thread(target=worker)
     t.daemon = True
     t.start()

for item in range(100):
    q.put(item)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions