Download the PHP package shipsaas/safe-dispatcher without Composer
On this page you can find all versions of the php package shipsaas/safe-dispatcher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shipsaas/safe-dispatcher
More information about shipsaas/safe-dispatcher
Files in shipsaas/safe-dispatcher
Package safe-dispatcher
Short Description Ensure your Queue msg is tracked and retryable when failed to dispatch.
License MIT
Informations about the package safe-dispatcher
Laravel Safe Dispatcher for Queues
For Laravel, it has the Queues feature, all cool and easy to use, right?
But what if it fails to dispatch a job? Then you have no idea for:
- What was the data inside the msg?
- What was the error? Traces?
- How to resend the Queue msg with minimal effort?
Then it will cost you a lot of time to check the log, sentry issues, create retry command,... Awful, IKR?
Worries no more, SafeDispatcher got your back. Check out how it works below.
Documentation:
- This README
- APIs
- GUI
How SafeDispatcher works?
SafeDispatcher will:
- Store the failed to dispatch msgs.
- Retry them on demand.
- You can even change the connection driver or the name on retry.
- Would really come in handy when you have a
SQSException
(size > 256kb), then you can resend using redis/database driver.
- Would really come in handy when you have a
- Ensure that your processing/flow is still working properly (no 500 server error from HTTP or exceptions from queue worker).
- Super useful & helpful for mission-critical apps.
Requirements
- Laravel 9+ & 10+
- PHP 8.1 & 8.2
Installation
Usage
Dependency Injection
Use Trait for your Job
Quick Helper Functions
Cover Queue Facade (v1.2.0+)
Learn more Cover Queue Facade
Notes
- SafeDispatcher hasn't supported with batching & chaining.
- Alternatively, you can do normal
::safeDispatch
and after finish your job, dispatch another,...
- Alternatively, you can do normal
- SafeDispatcher considers the
sync
Queue as a Queue Msg.- Therefore, if the handling fails, Queue Msg will be stored too.
- SafeDispatcher ships some helpful APIs too, check it out: APIs
Tests
SafeDispatcher is not only have normal Unit Testing but also Integration Test (interacting with MySQL for DB and Redis for Queue).
We're planning to add other queue drivers too (database or SQS).
To run the test, hit this:
Contribute to the project
- All changes must follow PSR-1 / PSR-12 coding conventions.
- Unit testing is a must, cover things as much as you can.
Maintainers & Contributors
- Seth Phat
Join me 😉
This library is useful?
Thank you, please give it a ⭐️⭐️⭐️ to support the project.
Don't forget to share with your friends & colleagues 🚀
License
Copyright © by ShipSaaS 2023 - Under MIT License.