Packages

o

dynamics.common

fs2helpers

object fs2helpers

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. fs2helpers
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def evalN[F[_], A](fs: Seq[F[A]], n: Int = 10)(implicit F: Effect[F], ec: ExecutionContext): F[Vector[A]]

    Given a list of Fs, eval them at most N at a time.

    Given a list of Fs, eval them at most N at a time. Output order is not preserved.

  2. def liftToPipe[A, B](f: (A) ⇒ IO[B]): Pipe[IO, A, B]

    Use it with Stream.through.

  3. def liftToSink[A](f: (A) ⇒ IO[Unit]): Sink[IO, A]

    Lift f to Sink.

    Lift f to Sink. Use with Stream.observe.

  4. def log[A](f: (A) ⇒ Unit): Pipe[IO, A, A]

    Log something.

    Log something. Runs f in a IO.

  5. def parallelWithLimit[A](limit: Int, as: List[IO[A]]): IO[List[A]]

    From cats-effect gitter channel.

    From cats-effect gitter channel. This does not use fs2 at all actually and does not work from a queue so its incrementally parallel.

  6. def pollWait[A](f: ⇒ IO[A], stop: (A) ⇒ Boolean, poll: FiniteDuration = 10.seconds)(implicit sch: Scheduler, F: Async[IO], ec: ExecutionContext): Stream[IO, A]

    Given an effect F, wait until the criteria stop is met.

  7. def shortenDelay(delay: FiniteDuration, fraction: Double = 0.95): FiniteDuration

    Calculate a delay but use fraction to shorten the delay.

  8. def sleepFirst[F[_], O](delta: FiniteDuration)(implicit F: Async[F], s: Scheduler, ec: ExecutionContext): Pipe[F, O, O]

    A pipe that given a stream, delays it by delta.

  9. def throttle[F[_], A](delay: FiniteDuration = 5.millis)(implicit sch: Scheduler, ec: ExecutionContext, F: Effect[F]): Pipe[F, A, A]

    Throttle a stream.

    Throttle a stream. Default value is for dynamics throttling.

  10. def unfoldEvalWithDelay[F[_], A](f: ⇒ F[Option[A]], getDelay: (A) ⇒ FiniteDuration)(implicit M: Functor[F], F: Async[F], t: Timer[F]): Stream[F, A]

    Unfold, periodically checking an effect for new values.

    Unfold, periodically checking an effect for new values. Time between checks is obtained using getDelay potentially using the returned effect value. f is run immediately when the stream starts. The delay originates from Timer[F] (on the F async functor) and not from a fs2 scheduler.

    f

    Call an effect to get a value.

    getDelay

    Extract amount to delay from that value.