Skip to content

Commit df0b65e

Browse files
committed
Add explanation comment for the _FETCH_WAIT_MAX_MS value
1 parent c455667 commit df0b65e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/imas_streams/kafka.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
_INITIAL_BACKOFF_TIME = 0.02 # seconds
2727
_MAXIMUM_BACKOFF_TIME = 1.0 # seconds
2828
_STREAMING_HEADER_KEY = "streaming-imas-metadata"
29-
_FETCH_WAIT_MAX_MS = 50
29+
# Kafka server will wait maximal _FETCH_WAIT_MAX_MS before sending new messages to the
30+
# consumer. Adjusted from the default (500ms) to decrease latency, especially when using
31+
# "most_recent_only" since a seek() needs to wait at least this amount of time before it
32+
# is effective (see KafkaConsumer._fast_forward()).
33+
_FETCH_WAIT_MAX_MS = 50 # milli-seconds
3034

3135

3236
class KafkaSettings(BaseModel):

0 commit comments

Comments
 (0)