Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Un-separate synchronous vs asynchronous in interface; call operation blo... #7

Open
wants to merge 1 commit into
base: feature/ns-operations
Choose a base branch
from

Conversation

jacobjennings
Copy link
Contributor

...ck directly in synchronous case to guarantee completionBlock called before returning

waitUntilFinished was not reliable because it doesn't guarantee the
completionBlock being called, only the operation being completed. I confirmed this by noting that the resultImage in the operation block was never nil, while the completion block was being called with a nil image.

Let me know what you think of the interface change.

…block directly in synchronous case to guarantee completionBlock called before returning

waitUntilFinished was not reliable because it doesn't guarantee the
completionBlock being called, only the operation being completed.
@JaviSoto
Copy link
Contributor

You're right, waitUntilFinished isn't safe. But I like keeping the interface more decoupled from the implementation details, and that's why I liked having two methods. I believe the waitUntilFinished issue could be solved by using dispatch_group_enter and dispatch_group_wait.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants