diff options
author | Viktor Klang (√) <viktor.klang@gmail.com> | 2014-03-10 14:21:58 +0100 |
---|---|---|
committer | Viktor Klang (√) <viktor.klang@gmail.com> | 2014-03-10 14:21:58 +0100 |
commit | 76add38fad942efa7f10457b1f96aba1cf360ea3 (patch) | |
tree | e6e255d0048e318cb7d8d0f57aac79705d86e0a6 /src | |
parent | 40b7832823d5e1cc39397b8960e62e0283bb0502 (diff) | |
download | scala-76add38fad942efa7f10457b1f96aba1cf360ea3.tar.gz scala-76add38fad942efa7f10457b1f96aba1cf360ea3.tar.bz2 scala-76add38fad942efa7f10457b1f96aba1cf360ea3.zip |
SI-8377 - Clarify the asynchronous requirement of ExecutionContext
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/concurrent/ExecutionContext.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/library/scala/concurrent/ExecutionContext.scala b/src/library/scala/concurrent/ExecutionContext.scala index a55432fd71..a1e94c8876 100644 --- a/src/library/scala/concurrent/ExecutionContext.scala +++ b/src/library/scala/concurrent/ExecutionContext.scala @@ -14,8 +14,13 @@ import scala.annotation.implicitNotFound import scala.util.Try /** - * An `ExecutionContext` can execute program logic, typically but not - * necessarily on a thread pool. + * An `ExecutionContext` can execute program logic asynchronously, + * typically but not necessarily on a thread pool. + * + * A general purpose `ExecutionContext` must be asynchronous in executing + * any `Runnable` that is passed into its `execute`-method. A special purpose + * `ExecutionContext` may be synchronous but must only be passed to code that + * is explicitly safe to be run using a synchronously executing `ExecutionContext`. * * APIs such as `Future.onComplete` require you to provide a callback * and an implicit `ExecutionContext`. The implicit `ExecutionContext` |