All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cps.stream.monix.ObservableEmitAbsorber.scala Maven / Gradle / Ivy

There is a newer version: 0.9.22
Show newest version
package cps.stream.monix

import cps.monads.monix.{*,given}

import monix.eval.*
import monix.execution.*
import monix.reactive.*

import cps.*
import cps.stream.*
import scala.concurrent.*

given ObservableEmitAbsorber[T](using ExecutionContext):  BaseUnfoldCpsAsyncEmitAbsorber[Observable[T],Task, CpsMonadInstanceContextBody[Task], T] with 

  override type Element = T

  def asSync(task: Task[Observable[T]]): Observable[T] =
        Observable.fromTask(task).flatten


  def unfold[S](s0:S)(f:S => Task[Option[(T,S)]]):Observable[T] =
        Observable.unfoldEval[S,T](s0)(f)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy