Closed justinHowlett closed 1 month ago
Hey @justinHowlett
I don't see any reason why it wouldn't be safe. Have you faced any issue with that?
AFAIK, the metadata is loaded every time a new instance is created, the reason is probably because PNK is not something that you would keep it active for a long time, but if you do, then you are responsible of keeping the instance alive.
There were some issues regarding thread safety in the past, but it shouldn't be the case in the current state.
I hope it helps you.
Thanks @bguidolim it looks thread-safe yes. I just didn't want to assume it would be thread-safe moving forward. Having a future version break the thread safety guarantee for instance.
I appreciate your quick response!
Hello, since PhoneNumberKit parses a large amount of metadata JSON on initialization I would like to know whether it is currently safe and will continue to be safe to initialize PhoneNumberKit on a background thread.
i.e is PhoneNumberKit thread safe / same-thread safe etc...
Currently the initialization causes a 33-50ms stall on my iPhone 12 Pro.
Thanks.