Created
July 6, 2015 11:11
-
-
Save kermitas/eed4e7ed8d0675adba76 to your computer and use it in GitHub Desktop.
Prerequisites for Akka dispatcher.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package akka.dispatch | |
| /** | |
| * Composition over [[DefaultDispatcherPrerequisites]] that replaces thread factory with one that allow to configure thread priority. | |
| * | |
| * @param newThreadPriority priority that will be set to each newly created thread | |
| * should be between Thread.MIN_PRIORITY (which is 1) and Thread.MAX_PRIORITY (which is 10) | |
| */ | |
| class PriorityThreadsDispatcherPrerequisites(prerequisites: DispatcherPrerequisites, newThreadPriority: Int) extends DefaultDispatcherPrerequisites( | |
| eventStream = prerequisites.eventStream, | |
| scheduler = prerequisites.scheduler, | |
| dynamicAccess = prerequisites.dynamicAccess, | |
| settings = prerequisites.settings, | |
| mailboxes = prerequisites.mailboxes, | |
| defaultExecutionContext = prerequisites.defaultExecutionContext, | |
| threadFactory = new PriorityThreadFactory(prerequisites, newThreadPriority) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment