Custom RejectedExecutionHandler for AsyncExecutor

13 views
Skip to first unread message

Igor Urisman

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

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,

—Igor.

Reply all
Reply to author
Forward
0 new messages