Skip to content

Commit 2a7f5f7

Browse files
Merge pull request #787 from i/i.fix-format
Fix formatting of code snippets in Future docs
2 parents 1800f72 + 68e5177 commit 2a7f5f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

overviews/core/_posts/2012-09-20-futures.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ As explained in the `ForkJoinPool` API, this is only possible if the pool is exp
121121
Fortunately the concurrent package provides a convenient way for doing so:
122122

123123
import scala.concurrent.Future
124-
import scala.concurrent.blocking
124+
import scala.concurrent.blocking
125125

126126
Future {
127127
blocking {
@@ -165,16 +165,16 @@ One might be tempted to have an `ExecutionContext` that runs computations within
165165

166166
val currentThreadExecutionContext = ExecutionContext.fromExecutor(
167167
new Executor {
168-
// Do not do this!
168+
// Do not do this!
169169
def execute(runnable: Runnable) { runnable.run() }
170170
})
171171

172172
This should be avoided as it introduces non-determinism in the execution of your future.
173173

174174
Future {
175-
doSomething
176-
}(ExecutionContext.global).map {
177-
doSomethingElse
175+
doSomething
176+
}(ExecutionContext.global).map {
177+
doSomethingElse
178178
}(currentThreadExecutionContext)
179179

180180
The `doSomethingElse` call might either execute in `doSomething`'s thread or in the main thread, and therefore be either asynchronous or synchronous.

0 commit comments

Comments
 (0)