Jérôme Gully
01/12/2021, 10:16 AMensureNeverFrozen
from common code or swift code ?
For the moment I only can access concurrent functions like freeze
and ensureNeverFrozen
in the iosMain shared code. I have an InvalidMutabilityException
calling ktor get function but I only call common code and can't use ensureNeverFrozen
in commin code to debugnrobi
01/12/2021, 10:28 AMfreeze()
and ensureNeverFrozen()
are K/N only.
A common pattern is to create your own expect/actual, which does nothing on K/JVM and K/JS targets and calls the actual freeze()
on K/N.
For ex: Ktor is exposing it’s own makeShared()=freeze()
and preventFreeze()=ensureNeverFrozen()
.
Also I’m not sure if this K/N only design is something intended from JBnrobi
01/12/2021, 10:29 AMJérôme Gully
01/12/2021, 10:45 AM