Now, let's send some data to the task function. This time, we care about the output of the task function and also we want it to raise an exception whe

pyrustic / threadom

submited by
Style Pass
2021-06-23 00:30:08

Now, let's send some data to the task function. This time, we care about the output of the task function and also we want it to raise an exception when the input data is an odd number.

This seems nice, but what if we have a long-running task that produces some data that should be immediately consumed by the GUI ? You know, a task we can't wait it returns.

You can pause the queue consuming process whenever you want, resume it, or stop it. The Threadom.consume method returns a qid (queue ID). So you can do threadom.pause(qid). Read the reference to get more details. I recommend you to use the class threadom.QueueTail to indicate the tail of a queue.

This library is part of the Pyrustic Open Ecosystem. This is a work in progress. If you like it, adopt it, spread the words ;)

Pyrustic Framework and Dresscode come with Threadom, so you don't need to worry about the individual installation of Threadom if you use one of these frameworks.

Leave a Comment
Related Posts