-
Notifications
You must be signed in to change notification settings - Fork 56
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
Wait asynchronously for a deferred job to complete and get its return value #370
Comments
No, there's no such thing. The return values of tasks are ignored by Procrastinate. They are actually logged, but that's it. In particular they're not stored in the Note that |
So, let me see if I understand correctly:
|
Yep. Contrary to what I said in my previous comment, Procrastinate does have a function for retrieving a job by its id, but it's not part of the official API yet. jobs = app.manager.list_jobs(id=your_job_id)
job = jobs[0]
print(f"{job.status}") But this is an area of Procrastinate that is still in flux I'd say.
Yes.
Yes, it's used internally to wake up the Procrastinate workers when a new job is inserted into the queue.
Yep, you got that right. |
Alright, thanks for confirming! I'm contemplating a move from Celery to procrastinate because it fits our setup so well (the locking features in particular), but having to implement something similar to a result backend ourselves might be too risky. Final question: do you support anything similar to Celery's task chains, where one task's output is fed to the input of the next task in a sequence? |
In our applications, we use a Postgres table for storing results. We have a Postgres database which contains both the Procrastinate and application-specific objects. |
Well, given that we do not store the return value of a job (...yet), that's not something we have. But using the lock, you can make the equivalent of a sequence and ensure that a group of tasks will run in order (defer the tasks with the same lock value in order, and they will run in order). I think we could imagine a lot of things from what you're mentionning:
This all requires some time to setup, so if we agree, we could make scoped tickets. Would you be interested to participate in the development of some of those, @Korijn ? |
I would enjoy working on something like that, however I am currently plowing through a list of personal projects already so it will take some time before I would be able to get to it. Is that a problem? |
From my point of view, it's fine if it's not done soon, and I'll be glad to provide some help or guidance :) But if people want to tackle some steps before, it's first come first serve :) (as long as we create tickets and, ideally, assign ourselves to them on ping in them) |
Question is in the title. With this library, can you (asynchronously) wait for a deferred job to complete and get its return value? I couldn't find it in the docs.
Something like:
The text was updated successfully, but these errors were encountered: