Execution context for managing Play Java HTTP thread local state.
This is essentially a factory for getting an executor for the current HTTP context. Tasks executed by that executor
will have the HTTP context setup in them.
For example, it may be used in combination with
CompletionStage.thenApplyAsync
, to ensure the callbacks
executed when the completion stage is redeemed have the correct context:
CompletionStage<WSResponse> response = ws.url(...).get();
CompletionStage<Result> result = response.thenApplyAsync(response -> {
return ok("Got response body " + ws.body() + " while executing request " + request().uri());
}, httpExecutionContext.current());
Note, this is not a Scala execution context, and is not intended to be used where Scala execution contexts are
required.