Skip to content

Commit

Permalink
scalafixAll
Browse files Browse the repository at this point in the history
  • Loading branch information
homycdev committed Jul 3, 2023
1 parent 237a2ba commit 3c3f980
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
18 changes: 3 additions & 15 deletions core/shared/src/main/scala/cats/effect/IO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -362,22 +362,10 @@ sealed abstract class IO[+A] private () extends IOPlatform[A] {
/**
* Shifts the execution of the current IO to the specified [[java.util.concurrent.Executor]].
*
* @param executor
* @return
* @see [[evalOn]]
*/
def evalOnExecutor(executor: Executor): IO[A] = {
require(executor != null, "Cannot pass undefined Executor as an argument")
executor match {
case ec: ExecutionContext =>
evalOn(ec: ExecutionContext)
case executor =>
IO.executionContext.flatMap { refEc =>
val newEc: ExecutionContext =
ExecutionContext.fromExecutor(executor, refEc.reportFailure)
evalOn(newEc)
}
}
}
def evalOnExecutor(executor: Executor): IO[A] =
IO.asyncForIO.evalOnExecutor(this, executor)

def startOn(ec: ExecutionContext): IO[FiberIO[A @uncheckedVariance]] = start.evalOn(ec)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ package cats.effect.kernel.syntax

import cats.effect.kernel._

import java.util.concurrent.Executor
import scala.concurrent.ExecutionContext

import java.util.concurrent.Executor

trait AsyncSyntax {
implicit def asyncOps[F[_], A](wrapped: F[A]): AsyncOps[F, A] =
new AsyncOps(wrapped)
Expand Down

0 comments on commit 3c3f980

Please sign in to comment.