Questions: Has task run? Is running task completed?
See original GitHub issueHow can i check if a task has been called/run/completed?
Currently i looked into HUEY.pending()
and check if there the task has a result.
First: How can i easier get all pending task IDs? I do this:
def get_pending_ids_by_func(task_func):
task_pkg_path1 = "%s.%s" % (task_func.task_class.__module__, task_func.task_class.__name__)
pending_ids=set()
for pending_task in HUEY.pending(limit=None):
task_pkg_path2 = "%s.%s" % (pending_task.__module__, pending_task.name)
if task_pkg_path1 == task_pkg_path2:
pending_ids.add(pending_task.task_id)
return pending_ids
Then: I have the task ID and what to check if the task finished. Currently i check if result is not EmptyData
, e.g.:
result = HUEY.storage.peek_data(key=task_id)
if result is not EmptyData:
print("Task %r completed" % task_id)
else:
print("Task %r return EmptyData -> not completed." % task_id)
But it seems that this will not work, if the task return something and not return None
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
How to determine whether Task.Run is completed within a loop
I am using C#. I am stress testing so this is not quite production code. I upload data to my server via a...
Read more >Using Task.Run in Conjunction with Async/Await | Pluralsight
Run returns a Task which means you can use the await keyword with it! So let's explore using Task.Run in conjunction with async/await...
Read more >C# regarding running multiple task - Microsoft Q&A
Run (() =>; {; });; // Block until both tasks have completed. // This makes this method prone to deadlocking. // Consider using...
Read more >How to daisy chain tasks in the Windows Task Scheduler to ...
First we need to setup task X if you have not done so already with all the actions that you need for that...
Read more >Tasks in Visual Studio Code
When the compiler has finished, there should be a HelloWorld.js file. ... If you have cloned the eslint-starter example, then executing Run Tasks...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If I were your employer I’d probably fire you for wasting so much time.
This isn’t about testing Huey himself. It’s about testing the whole stack. That includes huey and redis as backend…
In my case it’s a docker compose project and django, huey, redis (and more) services are in separate containers…