-
Notifications
You must be signed in to change notification settings - Fork 82
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
Change Postal completion handlers queue #34
Comments
Like NSURLSession, I think we should create a "Configuration". Should we consider using an output |
I like your idea of a "Configuration" struct but we already have a "Configuration" parameter in the initializer related to the IMAP session. I don't like the idea of putting things like these into it. I would suggest instead adding a simple parameter in the initializer. It would look like this:
|
Disagree, in order to future proof the API We should indeed have a ProviderConfiguration. |
Ok fair enough. Have you an idea of what should be added in this new structure aside the completion queue ? |
At the moment the timeout parameter is provided "ad-hoc" in the connect func : |
To answer your question. However we have to remember that we used an EDIT: Personally I would like to switch to a full DispatchQueue implementation. WDYT? |
Today we dispatch results on the main thread because we assume that Postal is mostly used for UI purpose which is not necessarily true.
It's just an idea but I think we should remove this behaviour because if we use Postal for processing purpose we may not want Postal to enqueue on the main queue (even if here we are talking about very lightweight messages). Users might want to save some computations from the main-thread before actually displaying something to the UI.
So I would propose to drop this behaviour. As an example
NSURLSession
doesn't dispatch on the main thread even if the most common usage of it is to display something fetched from internet on the UI. And if we think about it. Postal and NSURLSession do, in a sense, the same kind of work...As an alternative, we could add an option to the Postal instance or adding a parameter to methods that have a completion handler to let the choice to dispatch results on the main thread or not.
The text was updated successfully, but these errors were encountered: