Clean up same thread execution contexts #26690

* deprecate internal sameThread ec and use a new one for all internal use sites
* Use the respective Scala version standard library "same thread" ec 
* fallback to the old inline impl on 2.12 when reflection isn't possible
This commit is contained in:
Johan Andrén 2020-03-10 15:39:30 +01:00 committed by GitHub
parent 59ce257209
commit d26453b5e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 248 additions and 165 deletions

View file

@ -398,7 +398,7 @@ import scala.util.control.NonFatal
.foreach {
case NonFatal(e) => p.tryFailure(e)
case _ => ()
}(akka.dispatch.ExecutionContexts.sameThreadExecutionContext)
}(akka.dispatch.ExecutionContexts.parasitic)
p.future
}
override def cancel(): Unit = {
@ -572,7 +572,7 @@ import scala.util.control.NonFatal
failStage(e)
}
try {
sinkFactory(element).onComplete(cb.invoke)(ExecutionContexts.sameThreadExecutionContext)
sinkFactory(element).onComplete(cb.invoke)(ExecutionContexts.parasitic)
} catch {
case NonFatal(e) =>
promise.failure(e)