Live.stop

Stop the session and finish processing received records.

A client can only be stopped after a successful connection is made by calling Live.subscribe.

This method does not block waiting for the connection to close. If this is desired, use Live.block_for_close or Live.wait_for_close to wait for the client to disconnect.

The connection will eventually close after calling this method. Once the connection has closed, the Live client can be reused but the session state is not preserved.

API method
1
Live.stop() -> None
Example usage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import databento as db

# Create a live client
client = db.Live(key="$YOUR_API_KEY")

# Subscribe to the trades schema for all ES futures
client.subscribe(
    dataset="GLBX.MDP3",
    schema="trades",
    stype_in="parent",
    symbols="ES.FUT",
)

# Start the streaming session
client.start()

# Stop the streaming session
client.stop()