nomisRev / kotlin-kafka

Kafka bindings for Kotlin `suspend`, and Kafka streaming operators for KotlinX Flow.
https://nomisRev.github.io/kotlin-kafka/
Apache License 2.0
103 stars 10 forks source link

Fix PollLoop threading, add documentation, and split functionality in smaller methods #158

Closed nomisRev closed 11 months ago

nomisRev commented 11 months ago

This PR is the start of the internal clean-up.

KafkaReceiver is in need of a cleaner implementation, better internal naming, and documentation. This PR kick starts that effort, since this PR already contains too many changes. All subsequent changes will be isolated in PRs.

KafkaReceiver might get renamed to KafkaSubscriber to match the Publisher name, this can be done while gracefully migrating.

The new threading model of the receiver allows more code to run on the user thread, while guaranteeing that as little as possible code runs on the receiver. It also temporarily added some development utilities to verify the threads during dev/testing.