KEMBAR78
Fix problem where some constructors in Template could block the main thread by fumito-ito · Pull Request #101 · groue/GRMustache.swift · GitHub
Skip to content

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
@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