eventStreamProcessor
This object requires Streaming Data Framework for MATLAB® Production Server™.
Description
Use an EventStreamProcessor object to apply a stream analytic
function to an event stream. Using EventStreamProcessor object functions,
you can automatically direct events from an event stream to a streaming analytic function,
enabling you to process large amounts of data in event streams.
You can run the streaming analytic function on a known number of event windows
synchronously, similar to a for-loop. You can also run it with a
desktop-hosted server to simulate asynchronous deployment in a production environment.
EventStreamProcessor functions can process streaming data sequentially
in batches by collecting events into windows of configurable size. When a window is full of
the requested number of events, the window of events is passed to the stream processing
analytic function. You can then save any results that the analytic function produces and
optionally publish them to a different stream.
A stream processing function can be stateful or stateless. For stateful functions, the
EventStreamProcessor object maintains state between calls to the stream
processing function. If the stream processing function changes the state, the function can
return the state as a second output argument. The EventStreamProcessor
object preserves these changes for the next function iteration.
Creation
Syntax
Description
esp = eventStreamProcessor(inputStream,streamFcn) creates an
EventStreamProcessor object, which applies the stream function
streamFcn to the event stream inputStream, and
sets the InputStream and StreamFunction properties, respectively, of this object.
esp = eventStreamProcessor(inputStream,streamFcn,initialState)
creates an EventStreamProcessor object that additionally initializes
persistent state with the function initialState and sets the InitialState property. If streamFcn is stateful, then
initialState is required.
esp = eventStreamProcessor(___,
sets object properties using one or more name-value arguments. Name is a property name
and Value is the corresponding value. You can specify multiple name-value arguments in any
order as
Name=Value)Name1=Value1,...,NameN=ValueN.
Properties
Object Functions
execute | Execute event stream processing function on specific number of event windows |
package | Package stream processing function into deployable archive configured by
EventStreamProcessor |
seek | Set position in event stream to begin processing events |
start | Start processing event streams using local test server |
startServer | Start local test server |
stop | Stop processing event streams using local test server |
stopServer | Shut down local test server |
Examples
Version History
Introduced in R2022b