Skip to content

Commit

Permalink
Document code as necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
taldekar committed Jan 23, 2025
1 parent 4b9f100 commit 3531106
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* - Ordered event processing with batching support
* - Configurable thread pools for publishers and subscribers
* - De-duplication of consecutive identical events
*
*
* Thread Safety: This implementation is thread-safe and can handle concurrent publications
* and subscriptions from multiple threads.
*
Expand Down Expand Up @@ -66,7 +66,7 @@ private interface TypedCallable<T> {
* A rejection handler that defers task queuing by creating a new thread when the executor's queue is full.
* Instead of dropping tasks or blocking the submitting thread, this policy creates a dedicated
* "JobSubmissionPopUpThread" to handle the queuing of rejected tasks.
*
*
* When a task is rejected (due to queue capacity being reached):
* 1. If the executor is running:
* - Creates a new thread to handle the rejected task
Expand All @@ -75,12 +75,12 @@ private interface TypedCallable<T> {
* throws RejectedExecutionException with the original exception as cause
* 2. If the executor is shutdown:
* - Immediately throws RejectedExecutionException
*
*
* This approach ensures:
* - Tasks are not lost during high load
* - The submitting thread is not blocked
* - Task ordering is maintained through the queue
*
*
* Note: Each rejection creates a new thread, which should be considered when
* using this handler in scenarios with frequent queue rejections.
*/
Expand Down Expand Up @@ -144,7 +144,7 @@ public void rejectedExecution(final Runnable runnable, final ThreadPoolExecutor
* );
*
* Thread Safety: This class is thread-safe and can handle concurrent task submissions
* from multiple threads while maintaining execution order.
* from multiple threads while maintaining execution order.
*/
public static final class OrderedThreadPoolExecutor {

Expand Down

0 comments on commit 3531106

Please sign in to comment.