Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Job](Fix)Improve Event Publishing with Timeout
### Summary: This PR refines the publishEvent method to improve event publishing reliability by introducing a timeout mechanism and enhanced logging. The changes allow for a more responsive system when attempting to publish events to the disruptor, especially in cases where the ring buffer may not have sufficient capacity at the time. #### Timeout Implementation: A 1-second timeout (in nanoseconds) is set, after which the event publishing attempt will stop if the required capacity is not available. The timeout is tracked using System.nanoTime() for precise elapsed time measurement. #### Remaining Capacity Check: The method checks if the remainingCapacity() of the ring buffer is greater than 1 (this can be adjusted based on your capacity requirements). If enough capacity is available, the event is published; otherwise, it waits and retries.
- Loading branch information