object StatusReply
- Source
- StatusReply.scala
- Alphabetic
- By Inheritance
- StatusReply
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final case class ErrorMessage(errorMessage: String) extends RuntimeException with NoStackTrace with Product with Serializable
Carrier exception used for textual error descriptions.
Carrier exception used for textual error descriptions.
Not meant for usage outside of StatusReply.
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
- val Ack: StatusReply[Done]
Scala API: A general purpose message for using as an Ack
- def ack(): StatusReply[Done]
Java API: A general purpose message for using as an Ack
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def error[T](exception: Throwable): StatusReply[T]
Java API: Create an error response with a user defined java.lang.Throwable.
Java API: Create an error response with a user defined java.lang.Throwable.
Prefer the string based error response over this one when possible to avoid tightly coupled logic across actors and passing internal failure details on to callers that can not do much to handle them.
For cases where types are needed to identify errors and behave differently enumerating them with a specific set of response messages may be a better alternative to encoding them as generic exceptions.
Also note that Pekko does not contain pre-built serializers for arbitrary exceptions.
- def error[T](errorMessage: String): StatusReply[T]
Java API: Create an status response with a error message describing why the request was failed or denied.
- def fromCallable[T](callable: Callable[T]): StatusReply[T]
Java API: Convert the result of a java.util.concurrent.Callable into a StatusReply.
Java API: Convert the result of a java.util.concurrent.Callable into a StatusReply.
If the callable completes successfully, wraps the result in a successful reply. If it throws an exception, converts the exception message to an error reply (discarding the original exception type, making it safe for remote serialization).
This is the Java-friendly equivalent of #fromTry.
- Since
2.0.0
- def fromCallableKeepException[T](callable: Callable[T]): StatusReply[T]
Java API: Convert the result of a java.util.concurrent.Callable into a StatusReply, keeping the original exception in case of failure.
Java API: Convert the result of a java.util.concurrent.Callable into a StatusReply, keeping the original exception in case of failure.
Unlike #fromCallable, this preserves the full exception object. This is useful when callers need to match on exception types, but requires that serializers are configured for the exception types used when communicating with remote actors.
This is the Java-friendly equivalent of #fromTryKeepException.
- Since
2.0.0
- def fromTry[T](status: Try[T]): StatusReply[T]
Scala API: Turn a scala.util.Try into a status reply.
Scala API: Turn a scala.util.Try into a status reply.
Transforms exceptions into status reply errors containing just the exception message string. This makes it safe for use with remote actors since Pekko includes built-in serializers for text-based error messages, unlike arbitrary exception types.
See #fromTryKeepException for passing the exception along as is.
- Since
2.0.0
- def fromTryKeepException[T](status: Try[T]): StatusReply[T]
Scala API: Turn a scala.util.Try into a status reply, keeping the original exception.
Scala API: Turn a scala.util.Try into a status reply, keeping the original exception.
Unlike #fromTry, this preserves the full exception object. This is useful when callers need to match on exception types, but requires that serializers are configured for the exception types used when communicating with remote actors.
Prefer #fromTry (string-based errors) when possible to avoid tightly coupled logic across actors and passing internal failure details on to callers that can not do much to handle them.
Also note that Pekko does not contain pre-built serializers for arbitrary exceptions.
- Since
2.0.0
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @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
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def success[T](value: T): StatusReply[T]
Java API: Create a successful reply containing
value - 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])
- object Error
Scala API for creating and pattern matching an error response
Scala API for creating and pattern matching an error response
For example:
case StatusReply.Error(exception) => ... - object Success
Scala API for creation and pattern matching a successful response.
Scala API for creation and pattern matching a successful response.
For example:
case StatusReply.Success(value: String) => ...