How do I subscribe to a new parameter in an already subscribed stream?

I have a subscription to a stream like so:

def on_stream_recv_handler(self, sc: qx.StreamConsumer):
        def on_data_recv_handler(_: qx.StreamConsumer, df: pd.DataFrame):
            # my processing code

        print("New stream: {}".format(sc.stream_id))
        buf = sc.timeseries.create_buffer("p0", "p1")
        buf.on_dataframe_released = on_data_recv_handler

I’m receiving data with the about code. Now, I’d like to add a new parameter p2 to this subscription. How do I do that?

You can subscribe to all parameters and than deal with it by yourself, or you can create new buffer when your required parameters change. There is not API for changing buffer parameters now.

It is as Tomas said, but there is an important distinction.

If you create a buffer without any filtering, it’ll allow you to write your own custom code to filter.

If you create a buffer with some filtering, then create another, the new buffer will not have access to the data the previous had, potentially making you miss data points. Also, in this case it is strongly advised to dispose the previous buffer to avoid unwanted memory use.

So all in all, I suggest going with the first solution, meaning no filtering.