Skip to content

Commit ca5bc3d

Browse files
committed
Remove TODOs
1 parent 4405357 commit ca5bc3d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Sources/SwiftKafka/KafkaBackPressurePollingSystem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class KafkaBackPressurePollingSystem {
2727
/// The state machine that manages the system's state transitions.
2828
let stateMachineLock: NIOLockedValueBox<StateMachine>
2929

30-
// TODO: docc
30+
/// Closure that takes care of polling `librdkafka` for new messages.
3131
var pollClosure: (() -> Void)?
3232
/// The ``NIOAsyncSequenceProducer.Source`` used for yielding the messages to the ``NIOAsyncSequenceProducer``.
3333
var sequenceSource: Producer.Source? {

Sources/SwiftKafka/KafkaProducer.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public actor KafkaProducer {
6969
private var client: KafkaClient
7070
/// Mechanism that polls the Kafka cluster for updates periodically.
7171
private let pollingSystem: KafkaBackPressurePollingSystem
72-
// TODO: docc
73-
private var runTask: Task<Void, Never>?
72+
/// Task that polls `librdkafka` for new acknowledgements at regular intervals.
73+
private var pollTask: Task<Void, Never>?
7474

7575
/// `AsyncSequence` that returns all ``KafkaProducerMessage`` objects that have been
7676
/// acknowledged by the Kafka cluster.
@@ -121,8 +121,7 @@ public actor KafkaProducer {
121121

122122
self.client = try KafkaClient(type: .producer, config: config, logger: self.logger)
123123

124-
// TODO: expose run to user?
125-
self.runTask = Task { [pollingSystem] in
124+
self.pollTask = Task { [pollingSystem] in
126125
await pollingSystem.run(pollInterval: .milliseconds(100))
127126
}
128127

@@ -179,8 +178,7 @@ public actor KafkaProducer {
179178
rd_kafka_topic_destroy(topicHandle)
180179
}
181180

182-
// TODO: kill PollingSystem
183-
self.runTask?.cancel()
181+
self.pollTask?.cancel()
184182

185183
self.state = .shutDown
186184
}

0 commit comments

Comments
 (0)