apache / pulsar-dotpulsar

The official .NET client library for Apache Pulsar
https://pulsar.apache.org/
Apache License 2.0
234 stars 60 forks source link

Add AsyncLock to Reader and Consumer classes #212

Closed entvex closed 5 months ago

entvex commented 5 months ago

Fixes #211 #208

Description

The changes in this pull request address concurrent read scenarios by introducing an AsyncLock to both the Reader and Consumer classes. The receive loop within these classes is now synchronized using this lock, ensuring proper management of concurrent reads. Additionally, the lock object is disposed during the disposal of the respective classes.

Testing

I manually verified that the Receive methods in the Reader and Consumer classes are now thread-safe, as expected.