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

Ability to add closure as a job #24

Closed
morrislaptop opened this issue Feb 18, 2021 · 2 comments
Closed

Ability to add closure as a job #24

morrislaptop opened this issue Feb 18, 2021 · 2 comments

Comments

@morrislaptop
Copy link

Would this be possible?

return Workflow::define('Build Job')
            ->addJob(function () use ($podcast) {
                 $podcast->publish();
            });
@ksassnowski
Copy link
Owner

Currently it wouldn't work because of how Venture keeps track of references. But it's definitely something that should be possible in the future. I'm still having a look at #14 which proposes changes to how Venture keeps track of dependencies between jobs. I think that would make adding a closure to a workflow possible as well.

I don't know when I will be able to get to it, however, since I'm in the middle of moving right now.

@ksassnowski ksassnowski mentioned this issue Jul 11, 2022
Closed
33 tasks
@ksassnowski
Copy link
Owner

This is now possible in v4. Here's the relevant section in the docs: https://laravel-venture.com/usage/configuring-workflows.html#adding-closures-as-jobs

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

No branches or pull requests

2 participants