Interface DurableExecutionPluginFactory

All Known Subinterfaces:
DurableExecutionPluginProvider
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DurableExecutionPluginFactory
Creates one DurableExecutionPlugin instance per Lambda invocation.

The SDK builds the InvocationInfo for an invocation, calls this factory with it, dispatches that invocation's hooks to the returned instance, and drops the instance when the invocation returns. A plugin instance therefore serves exactly one invocation and can hold per-invocation state in plain fields — no keying by execution ARN is needed, even when the execution environment runs several executions concurrently.

The InvocationInfo handed to the factory is the same instance the plugin's DurableExecutionPlugin.onInvocationStart(InvocationInfo) hook then receives.

Non-fatal factory failures are contained like non-fatal hook failures: the factory is logged and skipped for that invocation. A null result is also logged and skipped. VirtualMachineError and ThreadDeath propagate, including when wrapped by asynchronous completion/future exceptions.


 DurableConfig.builder()
     .withPlugins(info -> new MyPlugin(info.durableExecutionArn()))
     .build();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    createPlugin(InvocationInfo invocationInfo)
    Creates the plugin instance that serves the described invocation.
    default String
    Optional exclusive instrumentation group, validated before any invocation instance is created.
  • Method Details

    • createPlugin

      DurableExecutionPlugin createPlugin(InvocationInfo invocationInfo)
      Creates the plugin instance that serves the described invocation.
      Parameters:
      invocationInfo - the invocation the plugin instance will observe, including its immutable runtime header snapshot before any plugin spans are created
      Returns:
      the plugin instance for this invocation
    • getExclusiveGroup

      default String getExclusiveGroup()
      Optional exclusive instrumentation group, validated before any invocation instance is created.