object BiCallback
- Source
- BiCallback.scala
- Alphabetic
- By Inheritance
- BiCallback
- 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
- def apply[E]: Builders[E]
For building BiCallback objects using the Partially-Applied Type technique.
For building BiCallback objects using the Partially-Applied Type technique.
For example these are Equivalent:
BiCallback[Throwable].empty[String] <-> BiCallback.empty[Throwable, String]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def empty[E, A](implicit r: UncaughtExceptionReporter): BiCallback[E, A]
Creates an empty BiCallback, a callback that doesn't do anything in
onNext
and that logs errors inonError
with the provided monix.execution.UncaughtExceptionReporter. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def forked[E, A](cb: BiCallback[E, A])(implicit ec: ExecutionContext): BiCallback[E, A]
Given a BiCallback wraps it into an implementation that calls
onSuccess
andonError
asynchronously, using the given scala.concurrent.ExecutionContext.Given a BiCallback wraps it into an implementation that calls
onSuccess
andonError
asynchronously, using the given scala.concurrent.ExecutionContext.The async boundary created is "light", in the sense that a TrampolinedRunnable is used and supporting schedulers can execute these using an internal trampoline, thus execution being faster and immediate, but still avoiding growing the call-stack and thus avoiding stack overflows.
THREAD-SAFETY: the returned callback is thread-safe.
In case
onSuccess
andonError
get called multiple times, from multiple threads even, the implementation protects against access violations and throws a CallbackCalledMultipleTimesException.- See also
- def fromAttempt[E, A](cb: (Either[Cause[E], A]) => Unit): BiCallback[E, A]
Turns
Either[Cause[E], A] => Unit
callbacks into Monix callbacks.Turns
Either[Cause[E], A] => Unit
callbacks into Monix callbacks.These are common within Cats' implementation, used for example in
cats.effect.IO
.WARNING: the returned callback is NOT thread-safe!
- def fromPromise[E, A](p: Promise[Either[E, A]]): BiCallback[E, A]
Returns a BiCallback instance that will complete the given promise.
Returns a BiCallback instance that will complete the given promise.
THREAD-SAFETY: the provided instance is thread-safe by virtue of
Promise
being thread-safe. - def fromTry[A](cb: (Try[A]) => Unit): BiCallback[Throwable, A]
Turns
Try[A] => Unit
callbacks into Monix callbacks.Turns
Try[A] => Unit
callbacks into Monix callbacks.These are common within Scala's standard library implementation, due to usage with Scala's
Future
.WARNING: the returned callback is NOT thread-safe!
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- 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()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def safe[E, A](cb: BiCallback[E, A])(implicit r: UncaughtExceptionReporter): BiCallback[E, A]
Wraps any BiCallback into a safer implementation that protects against protocol violations (e.g.
Wraps any BiCallback into a safer implementation that protects against protocol violations (e.g.
onSuccess
oronError
must be called at most once).THREAD-SAFETY: the returned callback is thread-safe.
In case
onSuccess
andonError
get called multiple times, from multiple threads even, the implementation protects against access violations and throws a CallbackCalledMultipleTimesException. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def trampolined[E, A](cb: BiCallback[E, A])(implicit ec: ExecutionContext): BiCallback[E, A]
Given a BiCallback wraps it into an implementation that calls
onSuccess
andonError
asynchronously, using the given scala.concurrent.ExecutionContext.Given a BiCallback wraps it into an implementation that calls
onSuccess
andonError
asynchronously, using the given scala.concurrent.ExecutionContext.The async boundary created is "light", in the sense that a TrampolinedRunnable is used and supporting schedulers can execute these using an internal trampoline, thus execution being faster and immediate, but still avoiding growing the call-stack and thus avoiding stack overflows.
THREAD-SAFETY: the returned callback is thread-safe.
In case
onSuccess
andonError
get called multiple times, from multiple threads even, the implementation protects against access violations and throws a CallbackCalledMultipleTimesException.- See also
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- 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()