Comments (6)
Like NSURLSession, I think we should create a "Configuration".
The default configuration would setup the dispatch on main queue.
A custom configuration could allow the client to define its own dispatch queue.
What do you think ?
Should we consider using an output OperationQueue
like NSURLSession does or stay on DispatchQueue
? We will have to keep an internal serial DispatchQueue because libetpan is not thread safe at all, but we can propose the user to define an output OperationQueue.
from postal.
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:
open class Postal {
public init(configuration: Configuration, completionQueue: OperationQueue = .main)
from postal.
Disagree, in order to future proof the API
We should indeed have a ProviderConfiguration.
We should have another struct for PostalConnection Options (separation of concerns).
We are in breaking mode so we can allow ourselves to change this, But let's assume that other options will emerge.
from postal.
Ok fair enough. Have you an idea of what should be added in this new structure aside the completion queue ?
from postal.
At the moment the timeout parameter is provided "ad-hoc" in the connect func :
https://github.com/snipsco/Postal/blob/master/Postal/Postal.swift#L65
All of these tweaks Which are note provider specific could go there.
from postal.
To answer your question. OperationQueue
didn't seems to have change a lot for a while unlike DispatchQueue
so in my opinion DispatchQueue
would be better. Moreover I think that most of developers use it in a first place and switch to OperationQueue for a very specific case.
However we have to remember that we used an OperationQueue
for libetpan because of a bug of dispatch_async
that was sending some messages to the main thread..
EDIT: Personally I would like to switch to a full DispatchQueue implementation. WDYT?
from postal.
Related Issues (20)
- Type of expression is ambiguous without more context.
- @import Postal not working
- App crash on iPhone but runs successfully in simulator HOT 1
- Memory leaks while fetching last 10 mails HOT 2
- :-1: linker command failed with exit code 1 (use -v to see invocation) HOT 2
- Clean up from Xcode 10.2 changes HOT 2
- English localization deprecation warning
- Body: nil HOT 3
- ConnectionLogType.dataReceived: 1 NO [AUTHENTICATIONFAILED] Authentication failed login(description: "Authentication failed") HOT 1
- Not seeing any text/html parts in fetched messages HOT 2
- 0.5.0 (release in Cocoapods) won't compile in Swift 5.1 HOT 2
- Carthage build error HOT 1
- How to get All Mails
- Commandline App | Postal library | postal.connect | I get nothing back (no error or else)
- Certificate error
- How to fetch email body HOT 1
- Can not build on MacBook Air M1 HOT 5
- Is support for push (IDLE) planned?
- error. showing error: login(description: "Authentication Failed") HOT 3
- Further development? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postal.