consumeR<L, R, O> static method

Conveyor<Both<L, R>, O> consumeR<L, R, O>(
  1. Function1<R, Conveyor<Both<L, R>, O>> recv, [
  2. Function0<Conveyor<Both<L, R>, O>>? fallback
])

Implementation

static Conveyor<Both<L, R>, O> consumeR<L, R, O>(Function1<R, Conveyor<Both<L, R>, O>> recv, [Function0<Conveyor<Both<L, R>, O>>? fallback]) =>
    Conveyor.consume(new Both(BothDirection.RIGHT), (Either<Object, R> ea) => ea.fold(
        (err) => err == Conveyor.End ? (fallback == null ? halt() : fallback()) : Conveyor.halt(err)
    ,(R r) => Conveyor.Try(() => recv(r))));