object MonadUtil
- Alphabetic
- By Inheritance
- MonadUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def batchedSequentialTraverse[X, M[_], S](parallelism: Int, chunkSize: Int)(xs: Seq[X])(processChunk: (Seq[X]) => M[Seq[S]])(implicit M: Parallel[M]): M[Seq[S]]
Batched version of sequential traverse
Batched version of sequential traverse
Can be used to avoid overloading the database queue. Use e.g. maxDbConnections * 2 as parameter for parallelism to not overload the database queue but to make sufficient use of the existing resources.
- def batchedSequentialTraverse_[X, M[_], S](parallelism: Int, chunkSize: Int)(xs: Seq[X])(processChunk: (Seq[X]) => M[Unit])(implicit M: Parallel[M]): M[Unit]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def foldLeftM[M[_], S, A](initialState: S, xs: Iterable[A])(step: (S, A) => M[S])(implicit monad: Monad[M]): M[S]
- def foldLeftM[M[_], S, A](initialState: S, iter: Iterator[A])(step: (S, A) => M[S])(implicit monad: Monad[M]): M[S]
The caller must ensure that the underlying data structure of the iterator is immutable
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def parTraverseWithLimit[X, M[_], S](parallelism: Int)(xs: Seq[X])(processElement: (X) => M[S])(implicit M: Parallel[M]): M[Seq[S]]
Parallel traverse with limited parallelism
- def repeatFlatmap[M[_], A](m: M[A], f: (A) => M[A], counter: Int)(implicit monad: Monad[M]): M[A]
Repeatedly apply the same function to a monadic value
m
.Repeatedly apply the same function to a monadic value
m
. This can be used to retry until the limitcounter
is reached or the monadm
aborts.- Annotations
- @tailrec()
- def sequentialTraverse[X, M[_], S](xs: Seq[X])(f: (X) => M[S])(implicit monad: Monad[M]): M[Seq[S]]
- def sequentialTraverseMonoid[M[_], A, B](xs: Iterable[A])(step: (A) => M[B])(implicit monad: Monad[M], monoid: Monoid[B]): M[B]
Conceptually equivalent to
sequentialTraverse(xs)(step).map(monoid.combineAll)
. - def sequentialTraverse_[M[_], A](xs: Iterator[A])(step: (A) => M[_])(implicit monad: Monad[M]): M[Unit]
The caller must ensure that the underlying data structure of the iterator is immutable
The caller must ensure that the underlying data structure of the iterator is immutable
Do not use Cats' .traverse_ methods as Cats does not specify whether the
step
runs sequentially or in parallel for future-like monads. In fact, this behaviour differs for different versions of Cats. - def sequentialTraverse_[M[_], A](xs: Iterable[A])(step: (A) => M[_])(implicit monad: Monad[M]): M[Unit]
The implementation of
traverse
incats
is parallel, so this provides a sequential alternative.The implementation of
traverse
incats
is parallel, so this provides a sequential alternative. The caller must ensure that the Iterable is immutableDo not use Cats' .traverse_ methods as Cats does not specify whether the
step
runs sequentially or in parallel for future-like monads. In fact, this behaviour differs for different versions of Cats. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])