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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
handleOutput
(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 O
postProcessFluxFunctionResult
(I rawInputs, Object functionInputs, reactor.core.publisher.Flux<?> functionResult, SimpleFunctionRegistry.FunctionInvocationWrapper function, com.microsoft.azure.functions.ExecutionContext executionContext) Post-processes theFlux
result from a reactive function invocation before returning it to the Azure runtime.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.protected O
postProcessMonoFunctionResult
(I rawInputs, Object functionInputs, reactor.core.publisher.Mono<?> functionResult, SimpleFunctionRegistry.FunctionInvocationWrapper function, com.microsoft.azure.functions.ExecutionContext executionContext) Post-processes theMono
result from a reactive function invocation before returning it to the Azure runtime.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.
-
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 convert
the 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 bedifferent
from 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 bedifferent
from 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 theMono
result from a reactive function invocation before returning it to the Azure runtime. The default behavior is toMono.blockOptional()
andpossibly convert
the 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 bedifferent
from 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 theFlux
result from a reactive function invocation before returning it to the Azure runtime. The default behavior is toblock
andpossibly convert
the 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 bedifferent
from the rawInputsfunctionResult
- the Mono result from the function invocationfunction
- the invoked functionexecutionContext
- the Azure execution context- Returns:
- the possibly modified function results
-