package core
- Alphabetic
- By Inheritance
- core
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class DefaultMessageReceiveResult[F[_], M](message: F[M], attributes: Map[String, String], consumer: Option[MessageConsumer[F, _ >: M]], commit: F[Unit], rollback: F[Unit], underlyingMessageProvided: F[Any], underlyingContextProvided: F[Any]) extends MessageReceiveResult[F, M] with Product with Serializable
- trait MessageConsumer[F[_], M] extends AnyRef
The usual semantics of a consumer is that each message is delivered to exactly one receive or subscription.
The usual semantics of a consumer is that each message is delivered to exactly one receive or subscription. Therefore, multiple subscriptions on a consumer receive messages randomly. If messages need to be delivered multiple times, each receiver should have a separate consumer.
- trait MessageContext[F[_]] extends AnyRef
- implicit class MessageExtension[F[_], M] extends AnyRef
- trait MessageHandler[F[_], M] extends AnyRef
- trait MessageProducer[F[_], M] extends AnyRef
- trait MessageReceiveResult[F[_], M] extends AnyRef
- trait MessageSendResult[F[_], M] extends AnyRef
- trait MessageSubscription[F[_], M] extends AnyRef
- case class ReceiveTimeout(timeout: Option[Duration], cause: Throwable) extends IllegalStateException with Product with Serializable
- trait ReceiverClient[F[_], M] extends AnyRef
- trait Request[RESPONSE] extends AnyRef
Request[RESPONSE] cannot be covariant.
Request[RESPONSE] cannot be covariant. This is easy to see because to enforce the response type, reply(...) must have an argument type of RESPONSE which would be impossible with a covariant type parameter (if it was covariant, it would be possible to assign a Request[SUBTYPE1] to a Request[SUPERTYPE] and then call reply with a SUBTYPE2 as the response, which would break type safety). The consequence of the invariance is that:
1) reply(...) is type safe, which is good; 2) It is not possible to declare RequestResponseClient as RequestResponseClient[REQ <: Request[RESP], RESP] because that would assume covariance; 3) It is not possible to use something like Request[MyResponseType] as the common supertype for requests because that would assume covariance again - the solution is to use another supertype - e.g. declare a separate sealed trait MyRequestType to enforce type safety on the client and the consumers / producers - this is not a huge constraint though.
This is all the consequence of the requirement to enforce type safety on the response for each request and also the fact that we want a common reply(...) method declared in the Request trait. The other option would be the Akka typed route, which is basically making a reply sender reference part of the request message. The downside of that is:
1) A sender reference needs to be declared explicitly in every request message, making it part of the model; 2) The ask syntax is complicated and unintuitive - see https://doc.akka.io/docs/akka/current/typed/interaction-patterns.html#request-response; 3) Requires the existence of sender references with marshalling - this is fine in Akka where serializable references are assumed to be used everywhere, but it is quite intrusive if the application model is forced to have these references everywhere. I think extending the trait is less intrusive and less verbose.
Of course, the choice of adding Request[RESPONSE] does not preclude the addition of an Akka-style API at some point if extending the trait will ever become a constraint.
- trait RequestContext[F[_]] extends AnyRef
- implicit class RequestExtension[F[_], REQUEST] extends AnyRef
- trait RequestHandler[F[_], REQ, RESP] extends AnyRef
- trait RequestResponseClient[F[_], REQ, RESP] extends AnyRef
- trait RequestResponseMapping[REQUEST, RESPONSE] extends AnyRef
Type class to bind a request message type to a response type.
Type class to bind a request message type to a response type. It makes request-response mapping pluggable, without enforcing any kind of convention on the implementor.
- Annotations
- @implicitNotFound()
- trait RequestResponseResult[F[_], REQUEST, RESPONSE] extends AnyRef
- case class RequestTimeout(timeout: Duration, cause: Throwable) extends IllegalStateException with Product with Serializable
- case class SendMessageContext(attributes: Map[String, String] = Map()) extends Product with Serializable
- case class SendRequestContext(requestTimeout: Option[Duration] = None, attributes: Map[String, String] = Map()) extends Product with Serializable
- trait SendResponseResult[+RESP] extends AnyRef
- trait SenderClient[F[_], REQ] extends AnyRef
- trait Service[F[_]] extends AnyRef
- trait ServiceConfiguration extends AnyRef
Configuration for a service.
Configuration for a service. The service config can be used to create or deploy a service or to create a client for it. A service configuration can be shared between the server and client side.
- trait ServiceState[F[_]] extends AnyRef
- case class UnknownRequest[REQ](request: REQ) extends IllegalStateException with Product with Serializable
- implicit class requestResponseClientExtension[F[_], REQ, RESP] extends AnyRef
- implicit class requestTagBasedRequestResponseClientExtension[F[_], REQ, RESP] extends AnyRef
Value Members
- val CorrelationIdKey: String
- val RequestTimeoutKey: String
- val ResponseProducerIdKey: String
- val ResponseTopicKey: String
- implicit def requestResultToResponse[F[_], REQUEST, RESPONSE](requestResult: RequestResponseResult[F, REQUEST, RESPONSE]): F[RESPONSE]
- implicit def requestTagBasedRequestResponseMapping[REQUEST <: Request[_ <: RESPONSE], RESPONSE]: RequestResponseMapping[REQUEST, RESPONSE]
- implicit def sendRequest[F[_], REQUEST, RESPONSE](request: REQUEST)(implicit requestResponseMapping: RequestResponseMapping[REQUEST, RESPONSE], client: RequestResponseClient[F, _ >: REQUEST, _ >: RESPONSE], sendRequestContext: SendRequestContext = SendRequestContext(), M: Monad[F]): F[RESPONSE]
- object MessageHandler
- object ReceiveTimeout extends Serializable
- object RequestHandler
- object RequestTimeout extends Serializable