execute abstract method

Stream<Object?> execute(
  1. JsonMap args,
  2. ExecutionContext context
)

Invokes the function with the given args.

Returns a stream of values.

Reactivity:

  • Argument Changes: If the input args change (e.g. because they were bound to a changing data path), the ExpressionParser will re-invoke this function with the new arguments. The previous stream will be cancelled, and the new stream subscribed to. Therefore, a single stream instance does not need to handle argument changes.
  • Internal Changes: The stream should emit new values if the function's internal sources change (e.g. a clock tick, a network status change, or a subscription to a data path looked up via context).

The context is provided to allow the function to resolve other paths or interact with the DataModel if necessary (e.g. subscribeToValue).

Implementation

Stream<Object?> execute(JsonMap args, ExecutionContext context);