Skip to content

Inconsistency w.r.t Task#executeOn() documentation #107

Open
@maesenka

Description

@maesenka

When try out the code on https://github.com/monix/monix.io/blame/master/_docs/3x/eval/task.md#L599-L639 I see no difference between the two case with or without the asyncBoundary call.

In other words, it seems that now only the forked Task runs in the Scheduler.io() and the onFinish reverts to a thread from the default Scheduler.

Here's what I'm seeing in Ammonite:

@ val cancelable = {
    source.flatMap(_ => forked)
      .doOnFinish(_ => onFinish)
      .runToFuture
  }
Running on thread: main
Running on thread: my-io-592
Ends on thread: scala-execution-context-global-485
cancelable: monix.execution.CancelableFuture[Unit] = Async(Future(Success(())), monix.eval.internal.TaskConnection$Impl$$anon$1@1a799c73)

 @ val cancelable = {
    source.flatMap(_ => forked)
      .asyncBoundary
      .doOnFinish(_ => onFinish)
      .runToFuture
  }
Running on thread: main
Running on thread: my-io-592
Ends on thread: scala-execution-context-global-485
cancelable: monix.execution.CancelableFuture[Unit] = Async(Future(<not completed>), monix.eval.internal.TaskConnection$Impl$$anon$1@2d3c799e)


Is there something I'm missing? Or has there been a change in behavior since this was written?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions