Fixing race-conditions, now works albeit inefficiently when adding/removing actors rapidly
This commit is contained in:
parent
149d346e5f
commit
53e67d6b3e
6 changed files with 32 additions and 26 deletions
|
|
@ -132,16 +132,15 @@ class ExecutorBasedEventDrivenDispatcher(
|
|||
case JMSBasedDurableMailbox(serializer) => throw new UnsupportedOperationException("JMSBasedDurableMailbox is not yet supported")
|
||||
}
|
||||
|
||||
def start: Unit = if (active.isOff) active switchOn {
|
||||
protected def start: Unit = active switchOn {
|
||||
log.debug("Starting up %s\n\twith throughput [%d]", toString, throughput)
|
||||
}
|
||||
|
||||
def shutdown: Unit = if (active.isOn) active switchOff {
|
||||
protected def shutdown: Unit = active switchOff {
|
||||
val old = executorService.getAndSet(config.createLazyExecutorService(threadFactory))
|
||||
if (old ne null) {
|
||||
log.debug("Shutting down %s", toString)
|
||||
old.shutdownNow()
|
||||
uuids.clear
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue