Package com.smeup.kokos.sdk.caller
Class MicroExecutorHTTPClient
java.lang.Object
com.smeup.kokos.sdk.caller.MicroExecutorHTTPClient
- All Implemented Interfaces:
AutoCloseable
- Author:
- mattia.bonardi
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()executeFun(Fun fun, ExecutionContext context, boolean coreResponse) executeFunAsync(Fun fun, ExecutionContext context, boolean coreResponse) static MicroExecutorHTTPClientwithInterceptor(Consumer<HttpRequest.Builder> interceptor) Intercept the request builder to allow customization of FUN request to another microexecutor.withTimeout(Integer timeout)
-
Field Details
-
EXECUTE_FUN
- See Also:
-
-
Method Details
-
newClient
-
withTimeout
-
withInterceptor
Intercept the request builder to allow customization of FUN request to another microexecutor. This can be useful, for example, to attach authorization token for external services that can handle FUNs.- Parameters:
interceptor-- Returns:
-
executeFun
public HttpResponse<InputStream> executeFun(Fun fun, ExecutionContext context, boolean coreResponse) throws KokosServiceException - Throws:
KokosServiceException
-
executeFunAsync
public HttpResponse<InputStream> executeFunAsync(Fun fun, ExecutionContext context, boolean coreResponse) throws KokosServiceException - Throws:
KokosServiceException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-