Class FunctionInvoker<I,O>
java.lang.Object
org.springframework.cloud.function.adapter.azure.FunctionInvoker<I,O>
- Type Parameters:
I- input typeO- result type
- Direct Known Subclasses:
HttpFunctionInvoker
- Since:
- 3.2
- Author:
- Oleg Zhurakousky, Chris Bono
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidhandleOutput(I input, com.microsoft.azure.functions.OutputBinding<O> binding, com.microsoft.azure.functions.ExecutionContext context) handleRequest(com.microsoft.azure.functions.ExecutionContext context) handleRequest(I input, com.microsoft.azure.functions.ExecutionContext executionContext) protected OpostProcessFluxFunctionResult(I rawInputs, Object functionInputs, reactor.core.publisher.Flux<?> functionResult, SimpleFunctionRegistry.FunctionInvocationWrapper function, com.microsoft.azure.functions.ExecutionContext executionContext) Post-processes theFluxresult from a reactive function invocation before returning it to the Azure runtime.protected OpostProcessImperativeFunctionResult(I rawInputs, Object functionInputs, Object functionResult, SimpleFunctionRegistry.FunctionInvocationWrapper function, com.microsoft.azure.functions.ExecutionContext executionContext) Post-processes the result from a non-reactive function invocation before returning it to the Azure runtime.protected OpostProcessMonoFunctionResult(I rawInputs, Object functionInputs, reactor.core.publisher.Mono<?> functionResult, SimpleFunctionRegistry.FunctionInvocationWrapper function, com.microsoft.azure.functions.ExecutionContext executionContext) Post-processes theMonoresult from a reactive function invocation before returning it to the Azure runtime.protected OpostProcessReactiveFunctionResult(I rawInputs, Object functionInputs, org.reactivestreams.Publisher<?> functionResult, SimpleFunctionRegistry.FunctionInvocationWrapper function, com.microsoft.azure.functions.ExecutionContext executionContext) Post-processes the result from a reactive function invocation before returning it to the Azure runtime.
-
Constructor Details
-
FunctionInvoker
-
FunctionInvoker
public FunctionInvoker()
-
-
Method Details
-
handleRequest
-
close
public void close() -
handleOutput
-
handleRequest
-
postProcessImperativeFunctionResult
protected O postProcessImperativeFunctionResult(I rawInputs, Object functionInputs, Object functionResult, SimpleFunctionRegistry.FunctionInvocationWrapper function, com.microsoft.azure.functions.ExecutionContext executionContext) Post-processes the result from a non-reactive function invocation before returning it to the Azure runtime. The default behavior is topossibly convertthe result.Provides a hook for custom function invokers to extend/modify the function results handling.
- Parameters:
rawInputs- the inputs passed in from the Azure runtimefunctionInputs- the actual inputs used for the function invocation; may bedifferentfrom the rawInputsfunctionResult- the result from the function invocationfunction- the invoked functionexecutionContext- the Azure execution context- Returns:
- the possibly modified function results
-
postProcessReactiveFunctionResult
protected O postProcessReactiveFunctionResult(I rawInputs, Object functionInputs, org.reactivestreams.Publisher<?> functionResult, SimpleFunctionRegistry.FunctionInvocationWrapper function, com.microsoft.azure.functions.ExecutionContext executionContext) Post-processes the result from a reactive function invocation before returning it to the Azure runtime. The default behavior is to delegate topostProcessMonoFunctionResult(I, java.lang.Object, reactor.core.publisher.Mono<?>, org.springframework.cloud.function.context.catalog.SimpleFunctionRegistry.FunctionInvocationWrapper, com.microsoft.azure.functions.ExecutionContext)orpostProcessFluxFunctionResult(I, java.lang.Object, reactor.core.publisher.Flux<?>, org.springframework.cloud.function.context.catalog.SimpleFunctionRegistry.FunctionInvocationWrapper, com.microsoft.azure.functions.ExecutionContext)based on the result type.Provides a hook for custom function invokers to extend/modify the function results handling.
- Parameters:
rawInputs- the inputs passed in from the Azure runtimefunctionInputs- the actual inputs used for the function invocation; may bedifferentfrom the rawInputsfunctionResult- the result from the function invocationfunction- the invoked functionexecutionContext- the Azure execution context- Returns:
- the possibly modified function results
-
postProcessMonoFunctionResult
protected O postProcessMonoFunctionResult(I rawInputs, Object functionInputs, reactor.core.publisher.Mono<?> functionResult, SimpleFunctionRegistry.FunctionInvocationWrapper function, com.microsoft.azure.functions.ExecutionContext executionContext) Post-processes theMonoresult from a reactive function invocation before returning it to the Azure runtime. The default behavior is toMono.blockOptional()andpossibly convertthe result.Provides a hook for custom function invokers to extend/modify the function results handling.
- Parameters:
rawInputs- the inputs passed in from the Azure runtimefunctionInputs- the actual inputs used for the function invocation; may bedifferentfrom the rawInputsfunctionResult- the Mono result from the function invocationfunction- the invoked functionexecutionContext- the Azure execution context- Returns:
- the possibly modified function results
-
postProcessFluxFunctionResult
protected O postProcessFluxFunctionResult(I rawInputs, Object functionInputs, reactor.core.publisher.Flux<?> functionResult, SimpleFunctionRegistry.FunctionInvocationWrapper function, com.microsoft.azure.functions.ExecutionContext executionContext) Post-processes theFluxresult from a reactive function invocation before returning it to the Azure runtime. The default behavior is toblockandpossibly convertthe results.Provides a hook for custom function invokers to extend/modify the function results handling.
- Parameters:
rawInputs- the inputs passed in from the Azure runtimefunctionInputs- the actual inputs used for the function invocation; may bedifferentfrom the rawInputsfunctionResult- the Mono result from the function invocationfunction- the invoked functionexecutionContext- the Azure execution context- Returns:
- the possibly modified function results
-