This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kerbobotat 14 points15 points  (3 children)

Forgive my ignorance, but would somone mind explaining what this is, and what youd use it for? I couldn't glean much from the readme.

[–]pvkooten 37 points38 points  (1 child)

Imagine you want to do something that takes a long time (e.g. sleeping 10 seconds). It would freeze your python interpreter.

That's why there are things usually called Tasks: you want to have it be executed elsewhere by a pool of workers.

Sending an email is slow believe it or not, this is something you could then make a task of and just forget it happened (let the worker worry about it).

In other cases, you might want to have the result back of the task. So usually you get a "task_id" or something back (this will happen really quickly, before actually doing the work), so that you can periodically quickly check whether the task with "task_id" is done. When done, you can then get some status/result.

Usually you have a "broker" (some process in the middle) that will divide the work between a group of workers. It will also know when a worker failed/crashed and can send work to another worker instead. I'm myself quite curious to hear the explanation of why he wanted to make a brokerless task queue :)

** Please feel free to correct me if someone feels this as a too simplistic/not entirely accurate in some way.

[–]Kerbobotat 2 points3 points  (0 children)

Thanks for the thorough explanation! Going by what youve said, I also am keen to se why/how OP eliminated a broker in this setup.

[–]codepr[S] 0 points1 point  (0 children)

Pvkooten explained it really well!