apache / pulsar-client-python

Apache Pulsar Python client library
https://pulsar.apache.org/
Apache License 2.0
50 stars 42 forks source link

[feature request] Reader support seek by timestamp. #78

Closed shibd closed 1 year ago

shibd commented 1 year ago

Motivation

CPP client already supported, In python client, just need wrapper it.

haphut commented 1 year ago

I am confused why this was opened. There has been a test for seeking by timestamp for a while: https://github.com/apache/pulsar-client-python/blame/8c36eb70f981c6cc1dec7691c7ab759a5520204d/tests/pulsar_test.py#L1001 .

Though the time.sleep(0.5) right after looks questionable. Do we have to guess when the seek is finished before attempting to read?

shibd commented 1 year ago

I am confused why this was opened. There has been a test for seeking by timestamp for a while:

You are right. I missed it.

Though the time.sleep(0.5) right after looks questionable. Do we have to guess when the seek is finished before attempting to read?

I think not. It is a sync method. I push a PR to remove sleep.

haphut commented 1 year ago

Fantastic. Thank you!