Main Content

stop

Stop processing event streams using local test server

    This function requires Streaming Data Framework for MATLAB® Production Server™ and MATLAB Compiler SDK™.

    Syntax

    Description

    example

    stop(esp) stops processing event streams using a local test server (development version of MATLAB Production Server). Asynchronous event processing started with the start function continues until either the processor reaches the end of the stream or there is an explicit call to the stop function.

    Examples

    collapse all

    Assume that you have a Kafka® server running at the network address kafka.host.com:9092 that has a topic RecamanSequence.

    Also assume that you have a stateful streaming analytic function recamanSum and initialization function initRecamanSum.

    Create a KafkaStream object connected to the RecamanSequence topic.

    ks = kafkaStream("kafka.host.com",9092,"RecamanSequence");

    Create an EventStreamProcessor object that runs the recamanSum function.

    esp = eventStreamProcessor(ks,@recamanSum,@initRecamanSum);

    Start the test server, which also opens the Production Server Compiler (MATLAB Compiler SDK) app.

    startServer(esp);

    To start the test server from the app, click Test Client and then Start. For an example on how to use the app, see Test Client Data Integration Against MATLAB (MATLAB Compiler SDK).

    Navigate back to the MATLAB command prompt to start processing events.

    start(esp);

    In the Production Server Compiler app, the test server receives data.

    From the MATLAB command prompt, stop the event processing.

    stop(esp);

    Then, you can shut down the server using the stopServer function or by clicking Stop in the app UI.

    Input Arguments

    collapse all

    Object to process event streams, specified as an EventStreamProcessor object.

    Version History

    Introduced in R2022b