Skip to content

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