Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problem where some constructors in Template could block the main thread #101

Merged
merged 4 commits into from
Aug 23, 2024

Conversation

fumito-ito
Copy link
Collaborator

User can use constructors that pass URL when initializing a Template object. This constructor can generate a Template object from a string that exists not only locally, but also server-side.

Since this constructor calls NSString(contentsOf:encoding) internally, it could block the calling thread if the given URL is remote.

This change adds a constructor for a Template object that can be called in async for iOS 15 and above. This constructor allows remote resources to be used without blocking the calling thread.

fumito-ito and others added 4 commits August 23, 2024 14:36
…thread.

You can use constructors that pass `URL` when initializing a `Template` object. This constructor can generate a `Template` object from a string that exists not only locally, but also server-side.

Since this constructor calls `NSString(contentsOf:encoding)` internally, it could block the calling thread if the given URL is remote.

This change adds a constructor for a `Template` object that can be called in async for iOS 15 and above. This constructor allows remote resources to be used without blocking the calling thread.
@fumito-ito fumito-ito merged commit c4ee40e into master Aug 23, 2024
1 check passed
@fumito-ito fumito-ito deleted the fix/thread-lock-with-template-constructor branch August 23, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant