diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-10 10:29:09 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-10 10:29:09 -0700 |
commit | a910d0caf0fd4464378fa9c629730acce50eabb8 (patch) | |
tree | e6e255d0048e318cb7d8d0f57aac79705d86e0a6 /src | |
parent | 40b7832823d5e1cc39397b8960e62e0283bb0502 (diff) | |
parent | 76add38fad942efa7f10457b1f96aba1cf360ea3 (diff) | |
download | scala-a910d0caf0fd4464378fa9c629730acce50eabb8.tar.gz scala-a910d0caf0fd4464378fa9c629730acce50eabb8.tar.bz2 scala-a910d0caf0fd4464378fa9c629730acce50eabb8.zip |
Merge pull request #3613 from viktorklang/patch-1
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` |