Skip to content

Commit

Permalink
more startF -> startFiber fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
raulraja committed Feb 3, 2019
1 parent d28c514 commit ab0943e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions modules/docs/arrow-docs/docs/docs/effects/fiber/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ fun <A, B, C> parallelMap(first: IO<A>,
second: IO<B>,
f: (A, B) -> C): IO<C> =
fx {
val (fiberOne: Fiber<ForIO, A>) = first.startF(Default)
val (fiberTwo: Fiber<ForIO, B>) = second.startF(Default)
f(fiberOne.join.bind(), fiberTwo.join.bind())
val (fiberOne: Fiber<ForIO, A>) = Default.startfiber(first)
val (fiberTwo: Fiber<ForIO, B>) = Default.startFiber(second)
f(!fiberOne.join, !fiberTwo.join)
}
val first = IO.sleep(5000).map {
Expand Down Expand Up @@ -57,8 +57,8 @@ which allows us to register an operation to run on cancelation, error or complet
fun <A, B, C> parallelMap2(first: IO<A>,
second: IO<B>,
f: (A, B) -> C): IO<C> =
first.startF(Default).bracket(use = { (joinA, _) ->
second.startF(Default).bracket(use = { (joinB, _) ->
Default.startFiber(first).bracket(use = { (joinA, _) ->
Default.startFiber(second).bracket(use = { (joinB, _) ->
joinA.flatMap { a ->
joinB.map { b -> f(a, b) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import kotlin.coroutines.suspendCoroutine
* //sampleStart
* binding {
* val promise = Promise.uncancelable<ForIO, Int>(IO.async()).bind()
* val fiber = promise.get().startF(Dispatchers.Default).bind()
* val fiber = Dispatchers.Default.startFiber(promise.get()).bind()
* promise.complete(1).bind()
* fiber.join().bind()
* }.unsafeRunSync() == 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ interface Concurrent<F> : Async<F> {
* //sampleStart
* binding {
* val promise = Promise.uncancelable<ForIO, Int>(IO.async()).bind()
* val fiber = promise.get().startF(Dispatchers.Default).bind()
* val fiber = Dispatchers.Default.startFiber(promise.get()).bind()
* promise.complete(1).bind()
* fiber.join().bind()
* }.unsafeRunSync() == 1
Expand Down

0 comments on commit ab0943e

Please sign in to comment.