Packages

package std

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. final case class Const[+O](out: O) extends Fn[Any, O] with Product with Serializable

    A stage that always produces the same constant output, ignoring its input.

    A stage that always produces the same constant output, ignoring its input.

    Const wraps a fixed value out and returns it on every invocation, always succeeding (h8io.stages.Status.Success). Because it is a h8io.stages.base.Fn, it is stateless and can be reused freely.

    Example:

    val always42: Stage[Any, Int, Nothing] = Const(42)
    O

    the output type (covariant)

    out

    the constant value to produce on every invocation

  2. final case class Countdown[T](i: Long, n: Long) extends Endo[T, Nothing] with Endo[T, Nothing] with Product with Serializable

    An endomorphic stage that passes its input through for exactly n invocations and then signals pipeline completion.

    An endomorphic stage that passes its input through for exactly n invocations and then signals pipeline completion.

    On each of the first n − 1 calls the stage yields h8io.stages.Status.Success and decrements its counter. On the n-th call it yields h8io.stages.Status.Complete and resets to n. After any h8io.stages.Status.Complete the stage also resets to n, ready for reuse.

    Countdown is fully immutable: each state transition creates a new instance rather than mutating the current one.

    Preconditions (checked at construction via assume):

    • n > 0
    • 1 ≤ i ≤ n
    T

    the value type passed through unchanged

    i

    the remaining number of successful yields before completion (1 ≤ i ≤ n)

    n

    the total period length (must be positive)

  3. sealed case class DeadEnd(_dispose: () => Unit) extends StaticStage[Any, Nothing, Nothing] with Product with Serializable

    A terminal stage that never produces an output value.

    A terminal stage that never produces an output value.

    Every invocation of apply returns a pre-built h8io.stages.Yield.None with h8io.stages.Status.Complete, immediately signaling that the pipeline is finished. The h8io.stages.Yield instance is cached as a val to avoid allocation on each call.

    DeadEnd is the natural "end-of-stream" marker and is also returned by Countdown.apply when n ≤ 0 and by h8io.stages.operators.LocalSoftDeadline when the duration is non-positive.

    An optional _dispose hook can be supplied at construction to release resources when the stage is disposed; the companion object DeadEnd uses a no-op hook.

    _dispose

    a thunk invoked by h8io.stages.Evolution.dispose; defaults to a no-op in the companion object

  4. final class GlobalSoftDeadline[T] extends Endo[T, Nothing] with Endo[T, Nothing]

    An endomorphic stage that passes values through as long as a wall-clock deadline has not elapsed.

    An endomorphic stage that passes values through as long as a wall-clock deadline has not elapsed.

    The deadline is measured from the moment this instance is created: the timestamp ts is captured once at construction using now(). On each invocation, if the elapsed time (now() - ts) is less than duration (in nanoseconds), the stage yields h8io.stages.Status.Success; otherwise it yields h8io.stages.Status.Complete.

    The deadline is global in the sense that it is fixed at construction and never resets, unlike h8io.stages.operators.LocalSoftDeadline which resets after each successful evolution transition.

    T

    the value type passed through unchanged

Value Members

  1. object Coalesce extends Fn[Either[Any, Any], Any]

    A stage that collapses an Either by returning whichever side contains the value.

    A stage that collapses an Either by returning whichever side contains the value.

    Coalesce takes an Either[T, T] and returns the contained value, regardless of whether it is Left or Right. It always succeeds (h8io.stages.Status.Success) and never changes state, because it is a h8io.stages.base.Fn.

    Example:

    val stage: Fn[Either[String, String], String] = Coalesce[String]
  2. object Complete extends Endo[Any, Nothing] with Endo[Any, Nothing]

    A stage that immediately signals pipeline completion without dropping the input value.

    A stage that immediately signals pipeline completion without dropping the input value.

    Complete always yields h8io.stages.Status.Complete while still passing the input through as the output. It is useful as the terminal element in a pipeline to stop further processing after a condition is met (see h8io.stages.operators.CompleteIfSome).

    The singleton operates on Any and can be safely cast to any Fruitful.Endo[T] via apply[T].

  3. object Countdown extends Serializable

    Factory for Countdown stages.

  4. object DeadEnd extends DeadEnd

    Default no-op DeadEnd instance.

    Default no-op DeadEnd instance.

    Use DeadEnd directly as a stage or call DeadEnd(_dispose) to create a variant with a custom disposal hook.

  5. object GlobalSoftDeadline

    Factory for GlobalSoftDeadline stages.

  6. object Identity extends Endo[Any]

    A stage that passes its input through unchanged.

    A stage that passes its input through unchanged.

    Identity is a singleton h8io.stages.base.Fn that acts as the identity function: given any value, it returns the same value. It always succeeds (h8io.stages.Status.Success) and never changes state.

    The singleton operates on Any and can be safely cast to any specific Fn.Endo[T] via the apply[T] method, avoiding allocation on every use.

    Example:

    val stage: Fn.Endo[String] = Identity[String]

Ungrouped