foxglove / foxglove-python

🐍🦊 Python library for Foxglove Data Platform
MIT License
6 stars 10 forks source link

client: add method to stream messages asynchronously #96

Closed james-rms closed 1 year ago

james-rms commented 1 year ago

Public-Facing Changes

Adds iter_messages, for streaming messages from data platform asynchronously.

This method not have the same yielded type as get_messages, because the get_messages API was determined before we had proper message iteration in the MCAP python library.

In detail:

get_messages iter_messages
stream behavior downloads entire stream first yields the first element as soon as it is downloaded
element type (topic, mcap.Message, decoded message) (mcap.Schema, mcap.Channel, mcap.Message, decoded message)

In my opinion the get_messages API unneccessarily hides information from the MCAP that the user might want (like channel metadata, topic schema content). It's still easy for them to pull the topic out of the channel.

amacneil commented 1 year ago

launch review: 👍