Class FunctionInvoker<I,O>

java.lang.Object
org.springframework.cloud.function.adapter.azure.FunctionInvoker<I,O>
Type Parameters:
I - input type
O - result type
Direct Known Subclasses:
HttpFunctionInvoker

public class FunctionInvoker<I,O> extends Object
Since:
3.2
Author:
Oleg Zhurakousky, Chris Bono
  • Constructor Details

    • FunctionInvoker

      public FunctionInvoker(Class<?> configurationClass)
    • FunctionInvoker

      public FunctionInvoker()
  • Method Details

    • handleRequest

      public O handleRequest(com.microsoft.azure.functions.ExecutionContext context)
    • close

      public void close()
    • handleOutput

      public void handleOutput(I input, com.microsoft.azure.functions.OutputBinding<O> binding, com.microsoft.azure.functions.ExecutionContext context)
    • handleRequest

      public O handleRequest(I input, com.microsoft.azure.functions.ExecutionContext executionContext)
    • 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 to possibly 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 runtime
      functionInputs - the actual inputs used for the function invocation; may be different from the rawInputs
      functionResult - the result from the function invocation
      function - the invoked function
      executionContext - 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)
      Parameters:
      rawInputs - the inputs passed in from the Azure runtime
      functionInputs - the actual inputs used for the function invocation; may be different from the rawInputs
      functionResult - the result from the function invocation
      function - the invoked function
      executionContext - 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 the Mono result from a reactive function invocation before returning it to the Azure runtime. The default behavior is to Mono.blockOptional() and possibly 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 runtime
      functionInputs - the actual inputs used for the function invocation; may be different from the rawInputs
      functionResult - the Mono result from the function invocation
      function - the invoked function
      executionContext - 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 the Flux result from a reactive function invocation before returning it to the Azure runtime. The default behavior is to block and possibly 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 runtime
      functionInputs - the actual inputs used for the function invocation; may be different from the rawInputs
      functionResult - the Mono result from the function invocation
      function - the invoked function
      executionContext - the Azure execution context
      Returns:
      the possibly modified function results