Skip to content

Fetch results from jobs#26

Closed
Thynkon wants to merge 1 commit into
sheharyarn:masterfrom
Thynkon:fetch_jobs_results
Closed

Fetch results from jobs#26
Thynkon wants to merge 1 commit into
sheharyarn:masterfrom
Thynkon:fetch_jobs_results

Conversation

@Thynkon

@Thynkon Thynkon commented Jul 8, 2023

Copy link
Copy Markdown

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.
@sheharyarn

Copy link
Copy Markdown
Owner

Closing for now.

While the proposed changes look interesting and I appreciate your contribution, I would first prefer a deeper discussion regarding them before they're added to the codebase.

The goal is to introduce new features only when we've thought through them and have a non-breaking implementation plan.

@sheharyarn sheharyarn closed this Jun 11, 2026
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.

2 participants