Open ennru opened 5 years ago
@ennru, I just gave this some thoughts. Do you think something like this, would be good, naming and api wise?
def buildWithDefaults(implicit actorSystem: ActorSystem): AkkaHttpClientBuilder =
AkkaHttpClientBuilder(Some(actorSystem))
def buildWithDefaults(implicit actorSystemProvider: ClassicActorSystemProvider): AkkaHttpClientBuilder =
AkkaHttpClientBuilder(Some(actorSystemProvider.classicSystem))
def buildWithDefaults(implicit actorSystem: ActorSystem, executionContext: ExecutionContext): AkkaHttpClientBuilder =
AkkaHttpClientBuilder(Some(actorSystem), Some(executionContext))
Some thoughts, do we need the ClassicActorSystemProvider
here as well? Do you think its also good to have a variant with ActorSystem
and ExecutionContext
?
I think
def buildWithDefaults()(implicit actorSystem: ClassicActorSystemProvider): AkkaHttpClient
would make sense.
If an actor system isn't configured via
withActorSystem
this library creates its own actor system which is the best alternative when used via reflection.It might be useful to complement the
AkkaHttpClient
with abuilder
method that expects an implicit actor system. I can't come up with a good name right now, though.