firebase-queue
firebase-queue copied to clipboard
Workflow style task chains
Is it possible to write workflows instead of simple task chains with this library?
Not currently. Do you have an example of what you're trying to achieve?
So i was thinking about doing a generic "share" worker. A share would get broken into multiple paths.
ie. share -> email generation -> send email share -> add to users inbox share -> ...
Right now it seems it is a simple chain X then Y then Z. I have been thinking about adding the ability to do a directed acyclic graph but it might not be a good fit for this project. Maybe the api can expose the internals more which would allow to build on top of this library.
On Thu, Jun 11, 2015 at 4:09 PM, Chris Raynor [email protected] wrote:
Not currently. Do you have an example of what you're trying to achieve?
— Reply to this email directly or view it on GitHub https://github.com/firebase/firebase-queue/issues/20#issuecomment-111303357 .
I've been considering having multiple success states, but I haven't figured out a way yet that doesn't rely on the processingFunction
having to know the exact states it's allowed to exit as or at least the number / order of such states.
It's possible to add tasks onto the queue from a task that's being processed, but doing so opens you up to race conditions if the process stops halfway through so it's not ideal.
For now, I think a linear path is a good compromise between performance and complexity, but if you have any specific ideas on how to improve this without making it too complicated I'd definitely take suggestions
Yeah I understand, i don't know the internals of the project well enough to suggest something specific at this point. But defining the transitions in the spec and allowing the user to set the finish state either based on a check function for each transition state, (dynamic in nature, check the resolved data), this would decouple the states from having to know about each other. So essentially each state would have conditions it needs satisfied in order to transition to it.
On Mon, Jun 15, 2015 at 12:06 PM, Chris Raynor [email protected] wrote:
I've been considering having multiple success states, but I haven't figured out a way yet that doesn't rely on the processingFunction having to know the exact states it's allowed to exit as or at least the number / order of such states.
It's possible to add tasks onto the queue from a task that's being processed, but doing so opens you up to race conditions if the process stops halfway through so it's not ideal.
For now, I think a linear path is a good compromise between performance and complexity, but if you have any specific ideas on how to improve this without making it too complicated I'd definitely take suggestions
— Reply to this email directly or view it on GitHub https://github.com/firebase/firebase-queue/issues/20#issuecomment-112176228 .