Closed benoist closed 9 years ago
Hi Benoist, this isn't quite possible as Gush uses sidekiq for job processing and that is executed in background.
If input is expected through a web-app for example, you could make a job which waits as long as it needs to until the input appears (in the database for example). Doing it through CLI is not possible with sidekiq.
I was thinking more in the line of processing the job until user input is required. The worker updates a state to mark a request for user input either through a web app or some other input. When the input is received the job is rescheduled and continues the flow. Essentially is creating 2+ workflow objects and combining them into 1 main flow.
Well, that would be a good way and can be done already in the current state of Gush.
What about user input to even start the job? e.g., say I wanted to start a whole workflow to publish a book... I'd need to know what book to even publish. How would I pass that into the workflow?
@stevenharman good point. That's what I'm working on now. Passing arguments to workflow, from which you can customize dependencies and pass more arguments down the line.
Will ping you once I push those changes :)
@stevenharman took a bit, but the workflows with arguments are now on master
:)
Check it out and I'd love to hear some feedback :point_right: https://github.com/pokonski/gush#passing-arguments-to-workflows
@pokonski Looking good! Thanks!
Hi,
I've had a look at your workflow gem. It looks really clean and neat. I do have a question about depending on user input. I've got some workflows that require user input in the middle of the flow. Is there any way to specify in the workflow, that an external update is required? I understand that this requires me to explicitly push the object in de workflow to the next state after the user input is received.
Cheers, Benoist