-
Notifications
You must be signed in to change notification settings - Fork 334
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
Question: Completion handlers are called in the original threads #40
Comments
@Hengyu It was intentional from the beginning, so that it's up to developer to dispatch in needed queue in the completion callback. But we could give another look at it and reconsider. What do you guys think @hyperoslo/ios |
I think it would be hard to define a silver bullet for this, there might be some causes where you don't want it to go back to the main queue. I think it is better to let the developer decide which queue should be used and when, just like @vadymmarkov stated. |
Hey! I’m just the user of Cache and want to share an opinion. In my point of view, the current approach is fine. Dispatching to the main queue «by default» is pretty bad move if you’re using |
I agree with @dreymonde, we will stick with the current approach for now. |
The
completion
s in class which conforms toStorageAware
is called in its original thread. For example, thecompletion
of aadd
method is called inwriteQueue
; thecompletion
of aobject
method is called inreadQueue
.If the cache read/write is associated, we should call
dispatch_async(dispatch_get_main_queue())
every the UI needs update.Maybe put
completion
in main thread will be better?for example:
change this
to
The text was updated successfully, but these errors were encountered: