Skip to content
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

Fetch results from jobs #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Thynkon
Copy link

@Thynkon Thynkon commented Jul 8, 2023

In some cases, we might want to launch a background job that will fetch some data. Thus, the result of the job must be available.

Now, on_success/1 becomes on_success/2 which receives both job and the result. Also, on_failure/2 now receives the job instead of the job's arguments.

Instead of simply launch a new worker with Supervisor.start_child/2, Task.Supervisor.async_nolink/3 is then called. Once the job finishes, the parent is then called.

This PR introduces breaking changes as Que.Worker.on_success/1 becomes Que.Worker.on_success/2 and Que.Worker.on_failure/2 now receives the job instead of the job's arguments.

Now, on_success/1 becomes on_success/2 which receives boths job and the
result. Also, on_failure/2 now receives the job instead of the job's
arguments.

In some cases, we might want to launch a background job that will fetch
some data. Thus, the result of the job must be available.

Instead of simply launch a new worker with Supervisor.start_child/2,
Task.Supervisor.async_nolink/3 is then called. Once the job finishes,
the parent is then called.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant