public interface StatefulFunction
StatefulFunctionis a user-defined function that can be invoked with a given input. This is the primitive building block for a Stateful Functions application.
StatefulFunction is an uniquely invokable "instance" of a registered
StatefulFunctionSpec. Each instance is identified by an
Address, representing the
function's unique id (a string) within its type. From a user's perspective, it would seem as if
for each unique function id, there exists a stateful instance of the function that is always
available to be invoked within a Stateful Functions application.
StatefulFunction can be invoked with arbitrary input from any another
StatefulFunction (including itself), or routed from ingresses. To invoke a
StatefulFunction, the caller simply needs to know the
Address of the target function.
As a result of invoking a
StatefulFunction, the function may continue to invoke other
functions, access persisted values, or send messages to egresses.
StatefulFunction may have persistent values written to storage that is
maintained by the system, providing consistent exactly-once and fault-tolerant guarantees. Please
see Javadocs in
AddressScopedStorage for an overview of how to
register persistent values and access the storage.
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.