Base type for custom exceptions raised within an actor
Provides the root actor which supervises other actors and handles spray http requests.
Provides the root actor which supervises other actors and handles spray http
requests. Use this wrapper as input anywhere you need access to an ActorSystem
, ActorRefFactory
, or
ExecutionContext
. Since an app generally has one ActorSystem
, treat this wrapper like a singleton -
create it on app startup and pass it to everywhere you need it.
Provides an implicit class which lets you treat an Akka akka.event.LoggingAdapter as a org.slf4j.Logger.
Provides an implicit class which lets you treat an Akka akka.event.LoggingAdapter as a org.slf4j.Logger.
Due to the ambiguity in the method overloading in the original interface, the implicit class cannot have any methods
that take a variable number of Any
s. If you need to call such a method with AnyVal
s, you will have to explicitly
convert them to AnyRef
s (i.e. put them in their equivalent Java classes).
info("{0}, {1}, {2}", Array(10, 20, 30).asInstanceOf[Array[AnyRef]]: _*)
This is a non-issue if you just use Scala's string interpolation instead of formatted strings.
CommonActor is intended for top-level actors that have robust error-handling, and that are responsible for receiving exceptions from other actors.
CommonActor is intended for top-level actors that have robust error-handling, and that are responsible for receiving exceptions from other actors. Generally, there should only be one actor (or a small pool of actors) extending this trait directly.
Implicit wrapper for Either objects, right-biased, with methods that interoperate with actors.
Implicit wrapper for Either objects, right-biased, with methods that interoperate with actors.
// given some ActorRef `actor` and a custom exception type `case class CustomException(e: Exception)` actor ! Right("hello").orFailureWith(new Exception("fail")) // sends "hello" actor ! Left("no").orFailureWith(new Exception("fail")) // sends Status.Failure(Exception("fail")) actor ! Left("no").orFailureWith(CustomException(_)) // sends Status.Failure(Exception("no"))
the left type of the Either
the right type of the Either
ServiceActor returns an error response for unhandled messages and escalates the error to the supervisor by throwing an exception.
ServiceActor returns an error response for unhandled messages and escalates the error to the supervisor by throwing an exception. For most child actors, this trait should be preferred.
Implicit wrapper for Try objects, with methods that interoperate with Actors
Implicit wrapper for Try objects, with methods that interoperate with Actors
// given some ActorRef `actor` val t = Try { ... } actor ! t.orFailure
// given some ActorRef `actor` val t = Try { ... } actor ! t.orFailureWith(new Exception("it died!"))
// given some ActorRef `actor` and a custom exception type `case class CustomException(e: Exception)` val t = Try { ... } actor ! t.orFailureWith(CustomException(_))
See https://issues.scala-lang.org/browse/SI-8806 for the rationale behind A >: Any.
the type of the Try
Exception raised when an unhandled message is received by a CommonActor
Convenience methods and implicit wrappers for working with akka.actor.Actor classes