EonX - EasyAsync
Makes dealing with async processes easier.
# Documentation
Coming soon...
# TODO
- [x] Implement messenger handlers for internal messages
- [x] Implement BatchObjectManager::approve
- [x] Handle nested batch completion
- [ ] Clean up code
# Logic
# Batch dispatch
- Create batch and its batchItems
- Dispatch batch
- Persist batch and its batchItems (OPTIONAL)
- Iterate through eligible batchItems and dispatch them
- Update all batchItems from each page status to pending
- Return batch
# Process BatchItem
- Identify if current message is for a batchItem, if not pass on
- Lock rest of process against the batchItem ID
- Fetch current batchItem based on its ID
- Fix batchItem status if still as created
- Fetch current batch based on its ID
- Inject them in current message if needed
- Process batchItem logic
- Prevent process if batchItem: alreadyProcessed, can't be retried, its batch is cancelled
- Increase batchItem attempts
- Set batchItem startedAt
- --- If any exception up to this point, message can be retried ---
- Execute message logic
- --- If any exception after this point, batchItem must be updated separately ---
- Set batchItem status
- Set batchItem finishedAt
- Persist batchItem changes
- Update and persist batch for batchItem
- Dispatch batchItem events
- Dispatch batch events
- Return result of message logic
!!! MOVE CORE LOGIC FROM LISTENERS TO CORE CODE !!!