Skip to content

Commit 6214e57

Browse files
committed
Document subscribe() regexp syntax (#56)
1 parent 312bd1f commit 6214e57

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

confluent_kafka/src/Consumer.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,11 @@ static PyMethodDef Consumer_methods[] = {
416416
"\n"
417417
" Set subscription to supplied list of topics\n"
418418
" This replaces a previous subscription.\n"
419+
"\n"
420+
" Regexp pattern subscriptions are supported by prefixing "
421+
"the topic string with ``\"^\"``, e.g.::\n"
422+
"\n"
423+
" consumer.subscribe([\"^my_topic.*\", \"^another[0-9]-?[a-z]+$\", \"not_a_regex\"])\n"
419424
"\n"
420425
" :param list(str) topics: List of topics (strings) to subscribe to.\n"
421426
" :param callable on_assign: callback to provide handling of "

0 commit comments

Comments
 (0)