Interface AsyncNodeAction<S extends AgentState>

Type Parameters:
S - the type of the agent state
All Superinterfaces:
Function<S,CompletableFuture<Map<String,Object>>>
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 AsyncNodeAction<S extends AgentState> extends Function<S,CompletableFuture<Map<String,Object>>>
Represents an asynchronous node action that operates on an agent state and returns state update.
  • Method Details

    • apply

      Applies this action to the given agent state.
      Specified by:
      apply in interface Function<S extends AgentState,CompletableFuture<Map<String,Object>>>
      Parameters:
      state - the agent state
      Returns:
      a CompletableFuture representing the result of the action
    • node_async

      static <S extends AgentState> AsyncNodeAction<S> node_async(NodeAction<S> syncAction)
      Creates an asynchronous node action from a synchronous node action.
      Type Parameters:
      S - the type of the agent state
      Parameters:
      syncAction - the synchronous node action
      Returns:
      an asynchronous node action