8000 Remove a paragraph following scala/scala.github.com@2143aa · rssh/scala.github.com@bfd2748 · GitHub
[go: up one dir, main page]

Skip to content

Commit bfd2748

Browse files
committed
Remove a paragraph following scala/scala.github.com@2143aa
1 parent 4a4b881 commit bfd2748

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

ja/overviews/core/futures.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -421,25 +421,6 @@ Future は同じ `Throwable` とともに失敗する。
421421

422422
anyQuote onSuccess { println(_) }
423423

424-
`either` コンビネータはこの Futuere もしくは引数として渡された Future
425-
の結果を持つ新たな Future を作成する。これは結果が成功か失敗したかに関わらず先に完了した方の値が採用される。
426-
以下は先に返ってきた為替レートを表示する具体例だ:
427-
428-
val usdQuote = future {
429-
connection.getCurrentValue(USD)
430-
} map {
431-
usd => "値: " + usd + " USD"
432-
}
433-
val chfQuote = future {
434-
connection.getCurrentValue(CHF)
435-
} map {
436-
chf => "値: " + chf + "CHF"
437-
}
438-
439-
val anyQuote = usdQuote either chfQuote
440-
441-
anyQuote onSuccess { println(_) }
442-
443424
`andThen` コンビネータは副作用の目的のためだけに用いられる。
444425
これは、成功したか失敗したかに関わらず現在の Future と全く同一の結果を返す新たな Future を作成する。
445426
現在の Future が完了すると、`andThen` に渡されたクロージャが呼び出され、新たな Future

0 commit comments

Comments
 (0)
0