1.

What Are The Different Policy In Executor Framework?

Answer»

There are DIFFERENT policy within ThreadPoolExecutor in JAVA

ThreadPoolExecutor.AbortPolicy : AbortPolicy is a handler for rejected task. It handles those task which has been rejected. 

ThreadPoolExecutor.CallerRunsPolicy : This also handles the rejected task and RUNS the rejected task DIRECTLY

ThreadPoolExecutor.DiscardOldestPolicy : This handles those rejected task that is OLDEST and unhandled. It discards those that oldest task. 

ThreadPoolExecutor.DiscardPolicy : This is the handler for those rejected task that are rejected silently.

There are different policy within ThreadPoolExecutor in java. 

ThreadPoolExecutor.AbortPolicy : AbortPolicy is a handler for rejected task. It handles those task which has been rejected. 

ThreadPoolExecutor.CallerRunsPolicy : This also handles the rejected task and runs the rejected task directly. 

ThreadPoolExecutor.DiscardOldestPolicy : This handles those rejected task that is oldest and unhandled. It discards those that oldest task. 

ThreadPoolExecutor.DiscardPolicy : This is the handler for those rejected task that are rejected silently.



Discussion

No Comment Found