async-kit
async-kit copied to clipboard
thread-specific userInfo on event loop
Currently there is no way to store arbitrary data on an event loop. It has been recommended previously to use a ThreadSpecificVariable
instead. While this works, the purpose of the code is arguably less clear. I think it could be nice to implement a userInfo
(or similar) data storage on EventLoop backed by a ThreadSpecificVariable
. If at some point NIO decides to add such storage to the event loop, this could be removed.
extension EventLoop {
var userInfo: [AnyHashable: Any] {
get { ... }
set { ... }
}
}