Comments (5)
Hi,
currently, there is no centralized storage broker which allows you to check the job status by its ID. This can be added on either PHP or Golang end (more reliable I think).
Can you describe the desired flow in more details so we can plan it properly? Our team has been requesting the same functionality and I want to make sure it's aligned.
from jobs.
We are using https://aws.amazon.com/en/swf/faqs/ to run complex workflows, it is possible to implement a similar pattern (decider + worker) but it will require at least another data storage to keep the execution state.
from jobs.
Swf similar pattern will be great, much more then i expected.
At first I was thinking about something simular to amqp "Message acknowledgment"
https://www.rabbitmq.com/confirms.html
In order to make sure a message is never lost, RabbitMQ supports message acknowledgments. An ack(nowledgement) is sent back by the consumer to tell RabbitMQ that a particular message has been received, processed and that RabbitMQ is free to delete it.
If a consumer dies (its channel is closed, connection is closed, or TCP connection is lost) without sending an ack, RabbitMQ will understand that a message wasn't processed fully and will re-queue it. If there are other consumers online at the same time, it will then quickly redeliver it to another consumer. That way you can be sure that no message is lost, even if the workers occasionally die.
from jobs.
All the brokers included in jobs already implement ASKs, including RabbitMQ. What we currently lack is complex logic here (a.k.a. what to do when job already failed):
https://github.com/spiral/jobs/blob/master/service.go#L308
This method will be invoked if the job fails after multiple attempts. I guess we can improve it in the future to automatically send the application the notice about the dead job and let it decide what to do next. It can even be PHP callback.
Technically implementing something like SWF is very simple, we can push an event to the application after each job execution/failure and let your code to decide what to do next or update the state machine.
I guess this is something we can drastically improve after the release and completion of documentation.
from jobs.
Actually, all the job events are already available and can be used to implement a state machine. But on Golang end, we have to expose them to PHP as well.
from jobs.
Related Issues (20)
- tune json.unmarshall package
- Redesign pointers usage
- Support of different AMQP Exchange types
- Deprecate repository and move it to the RR modules folder
- Support AMQP Routing Key
- [BUG] Error "missing header rr-attempt" although this header exist in AMQP message HOT 7
- nats broker? HOT 3
- [BUG] Setting maxAttempts don't work HOT 5
- AMQP consumer configuration
- Optimize JobExceptions
- Wrong dependency for PHP8.0 HOT 6
- Job pipelines are neither pause not resumed. HOT 1
- [BUG] RR is losing jobs under load HOT 1
- issue from github HOT 4
- issue from github_2
- issue from github spiral/jobs
- issue from github spiral/jobs2
- issue from github spiral/jobs3
- test issue from jira to go repo spiral
- PHP 8 / RoadRunner 2 Compatibility
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jobs.