-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PNLP-7915: replace confluent_kafka by aiokafka
- Loading branch information
1 parent
0a7edd4
commit 54a5726
Showing
11 changed files
with
1,876 additions
and
2,008 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from aiokafka.abc import ConsumerRebalanceListener | ||
|
||
if TYPE_CHECKING: | ||
from typing import List, Callable | ||
from kafka import TopicPartition | ||
from aiokafka import AIOKafkaConsumer | ||
|
||
|
||
class CoreConsumerRebalanceListener(ConsumerRebalanceListener): | ||
def __init__(self, consumer: AIOKafkaConsumer, | ||
on_assign_callback: Callable[[AIOKafkaConsumer, List[TopicPartition]], None]): | ||
self._consumer = consumer | ||
self._on_assign_callback = on_assign_callback | ||
|
||
def on_partitions_assigned(self, assigned: List[TopicPartition]): | ||
self._on_assign_callback(self._consumer, assigned) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.