Hi! Are `io.ktor.util.collections.ConcurrentMap` a...
# ktor
g
Hi! Are
io.ktor.util.collections.ConcurrentMap
and
io.ktor.util.collections.ConcurrentSet
considered public API (in terms of can I safely use it in my network module which already has dependency on Ktor)? I see only comment
Please do not use it.
on
ConcurrentMap
(and no comment on
ConcurrentSet
), but they both have public visibility and no
InternalAPI
annotation.
a
Which platforms do you target?
g
I'm developing multiplatform mobile app with Android and iOS targets
a
As I can see, the implementation of the
ConcurrentMap
is delegated to the
ConcurrentHashMap
on the JVM platform. On the POSIX targets, each operation of the
ConcurrentMap
is synchronized with a lock and the
LinkedHashMap
is used as a delegate. The
ConcurrentSet
uses the
ConcurrentMap
under the hood. I think it's safe to use these classes as long as the implementations fit your requirements.
g
Yeah, the implementation is fine, I considered using Ktor's implementation or copy-pasting something like this into my project if Ktor's maintainers consider this as an internal API. Thank you!