Live.terminate
Terminate the session and stop processing records immediately.
A client can only be terminated after a successful connection is made by calling Live.subscribe.
Unlike Live.stop, the session will end immediately and received records will no longer be processed.
Once terminated, the Live client can be reused but the session state is not preserved.
API method
1
Live.terminate() -> 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()
# Terminate the streaming session
client.terminate()