Skip to content

Commit b7d5fec

Browse files
committed
Remove TODOs
1 parent 52f572e commit b7d5fec

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.
@@ -123,8 +123,7 @@ public actor KafkaProducer {
123123
logger: self.logger
124124
)
125125

126-
// TODO: expose run to user?
127-
self.runTask = Task { [pollingSystem] in
126+
self.pollTask = Task { [pollingSystem] in
128127
await pollingSystem.run(pollInterval: .milliseconds(100))
129128
}
130129

@@ -167,8 +166,7 @@ public actor KafkaProducer {
167166
rd_kafka_topic_destroy(topicHandle)
168167
}
169168

170-
// TODO: kill PollingSystem
171-
self.runTask?.cancel()
169+
self.pollTask?.cancel()
172170

173171
self.state = .shutDown
174172
}

0 commit comments

Comments
 (0)