Package

io.catbird.util

effect

Permalink

package effect

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. effect
  2. RerunnableInstances
  3. FutureInstances
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait FutureInstances extends AnyRef

    Permalink
  2. trait RerunnableInstances extends AnyRef

    Permalink

Value Members

  1. object RerunnableClock

    Permalink
  2. object RerunnableContextShift

    Permalink

    The goal here is to provide an implicit instance for ContextShift[Rerunnable], so you can use libraries like fs2 in a finagle-based application without converting between Future and IO everywhere.

    The goal here is to provide an implicit instance for ContextShift[Rerunnable], so you can use libraries like fs2 in a finagle-based application without converting between Future and IO everywhere.

    Usage:

    implicit val rerunnableCS: ContextShift[Rerunnable] = RerunnableContextShift.global
  3. object RerunnableTimer

    Permalink

    Can be used to construct a cats.effect.Timer instance for Rerunnable which let's you delay execution or retrieve the current time via RerunnableClock.

    Can be used to construct a cats.effect.Timer instance for Rerunnable which let's you delay execution or retrieve the current time via RerunnableClock.

    Usage:

    // In a Finagle application
    implicit val timer: Timer[Rerunnable] = RerunnableTimer(com.twitter.finagle.util.DefaultTimer)
    
    // In tests (for instant execution of delays)
    implicit val timer: Timer[Rerunnable] = RerunnableTimer(com.twitter.util.Timer.Nil)
    
    // A dedicated `JavaTimer`
    implicit val timer: Timer[Rerunnable] = RerunnableTimer()
  4. implicit final val futureBracketInstance: Bracket[Future, Throwable]

    Permalink
    Definition Classes
    FutureInstances
  5. def futureToAsync[F[_], A](fa: ⇒ Future[A])(implicit F: Async[F]): F[A]

    Permalink

    Converts the Future to F without changing the underlying execution (same thread pool!).

  6. def futureToAsyncAndShift[F[_], A](fa: ⇒ Future[A])(implicit F: Async[F], CS: ContextShift[F]): F[A]

    Permalink

    The same as futureToAsync but doesn't stay on the thread pool of the Future and instead shifts execution back to the one provided by ContextShift[F] (which is usually the default one).

    The same as futureToAsync but doesn't stay on the thread pool of the Future and instead shifts execution back to the one provided by ContextShift[F] (which is usually the default one).

    This is likely what you want when you interact with libraries that return a Future like finagle-http where the Future is running on a thread pool controlled by the library (e.g. the underlying Netty pool). It also is closer to the behavior of IO.fromFuture for Scala futures which also shifts back.

  7. implicit final val rerunnableEffectInstance: Effect[Rerunnable]

    Permalink
    Definition Classes
    RerunnableInstances
  8. final def rerunnableToIO[A](fa: Rerunnable[A]): IO[A]

    Permalink

    Converts the Rerunnable to F without changing the underlying execution (same thread pool!).

  9. final def rerunnableToIOAndShift[A](fa: Rerunnable[A])(implicit CS: ContextShift[IO]): IO[A]

    Permalink

    The same as rerunnableToIO but doesn't stay on the thread pool of the Rerunnable and instead shifts execution back to the one provided by ContextShift[F] (which is usually the default one).

  10. final def tryToExitCase[A](ta: Try[A]): ExitCase[Throwable]

    Permalink

    Convert a twitter-util Try to cats-effect ExitCase

Inherited from RerunnableInstances

Inherited from FutureInstances

Inherited from AnyRef

Inherited from Any

Ungrouped