InMemoryHeaders
A thread-safe, in-memory implementation of SuspendMutableMap for storing string key-value pairs, typically used for managing headers in a concurrent environment.
This class ensures that all operations on the underlying map are atomic and safe to call from multiple coroutines simultaneously. It uses a Mutex to protect access to the internal MutableMap. The suspendable functions provide a non-blocking API for asynchronous access.
The collections returned by keys, values, and entries are immutable snapshots of the map's state at the time of the call, ensuring thread safety when iterating over them.
Functions
Checks if this map contains a mapping for the specified key. This operation is thread-safe.
Copies all of the mappings from the specified map from to this map. These mappings will replace any mappings that this map had for any of the keys that are currently in the specified map. This operation is performed atomically and is thread-safe.