A trait to simplify the creation and configuration of actors for sending HTTP requests.
The ''http'' package provides several extension actors to modify the behavior of a plain HttpRequestSender actor, including support for multiple authentication schemes. Usage of these features requires the creation of multiple actors, which are then plugged together.
This trait supports a more declarative way of constructing HTTP request sender actors. The idea is to define the desired features of the resulting actor using an HttpRequestSenderConfig object. A concrete implementation of this trait must evaluate the configuration and construct an actor that supports all the features requested. This not only simplifies client code but also increases testability, as mock implementations of this trait can be used.
Creates a new actor instance for sending HTTP requests to different hosts that satisfies the criteria defined by the given configuration. Note that the resulting actor is fully initialized; it is not necessary to call ''decorateRequestSender()'' manually.
Creates a new actor instance for sending HTTP requests to different hosts that satisfies the criteria defined by the given configuration. Note that the resulting actor is fully initialized; it is not necessary to call ''decorateRequestSender()'' manually.
Value parameters
config
the configuration of the request sender actor
requestActorFactory
a factory for creating new host-specific request sender actors
Creates a new actor instance for sending HTTP requests to the specified URI that satisfies the criteria defined by the given configuration. Note that the resulting actor is fully initialized; it is not necessary to call ''decorateRequestSender()'' manually.
Creates a new actor instance for sending HTTP requests to the specified URI that satisfies the criteria defined by the given configuration. Note that the resulting actor is fully initialized; it is not necessary to call ''decorateRequestSender()'' manually.
Decorates the given actor for sending HTTP requests to support all the features declared by the passed in configuration. Adding features to the given actor typically requires the creation of new actors that wrap the original one. The function returns an ''ActorRef'' that has been configured with all desired properties. This function can be used by clients that already have a basic HTTP sender actor and want to enhance it.
Decorates the given actor for sending HTTP requests to support all the features declared by the passed in configuration. Adding features to the given actor typically requires the creation of new actors that wrap the original one. The function returns an ''ActorRef'' that has been configured with all desired properties. This function can be used by clients that already have a basic HTTP sender actor and want to enhance it.