Custom RejectedExecutionHandler for AsyncExecutor

Skip to first unread message

Igor Urisman

Feb 11, 2020, 6:22:38 PM2/11/20
to Slick / ScalaQuery

Slick is backed by a custom executor, which is a wrapper around java.util.concurrent.ThreadPoolExecutor. This executor appears to be used with the default rejected execution handler ThreadPoolExecutor.AbortPolicy, which throws RejectedExecutionException when the task queue becomes full. This is not desired behavior for my use case: I'd rather block the fast producer than fail it, — which is exactly what the pre-canned ThreadPoolExecutor.CallerRunsPolicy would do if I could find a way to pass it to Slick.

Thanks in advance,


Reply all
Reply to author
0 new messages