confluent-kafka-go
confluent-kafka-go copied to clipboard
removed the readers-writer lock
and used an exclusive lock
The read lock alone is requested only when the key is not in cache and multiple Get requests are made concurrently. The ToMap method is called only from the client is holding an exclusive lock. Also, the lock is hold only for a short time, being an in memory cache.
The speed gain shouldn't be noticeable so simplicity can be preferred.