Interface NodeBody<I,O>

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

@Experimental @FunctionalInterface public interface NodeBody<I,O>
The body of a FunctionNode, which takes the node run's context and its single input; the input may be shared with other nodes, so the body must not mutate it. It runs on the node's scheduler (FunctionNode.Builder.scheduler), by default the Runner's, so it may block, and a small fixed-size scheduler can deadlock bodies that wait for one another. Canceling the node interrupts the body's thread and drops its result, and the node's attempt ends only once the body returns, so a body that ignores the interrupt holds up the retry and the caller. Disposing the whole run does not wait for it.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable O
    apply(Context context, @Nullable I input)
    Returns null for no output, an Event to send with any output in JSON form, or the output, which is sent in its JSON form; a returned Content is the output, not a message.