Skip to content
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

Dictate DispatchQueue Choice at Init #333

Open
kyledotmp3 opened this issue Dec 1, 2020 · 1 comment
Open

Dictate DispatchQueue Choice at Init #333

kyledotmp3 opened this issue Dec 1, 2020 · 1 comment

Comments

@kyledotmp3
Copy link

kyledotmp3 commented Dec 1, 2020

Was trying to use this in a server-side swift project but unfortunately we don't have an option with Swifter right now to dictate which thread is being used...

Right now it's hardcoded to .main:

DispatchQueue.main.async {
  let session = URLSession(configuration: .default, delegate: self, delegateQueue: .main)
  self.dataTask = session.dataTask(with: self.request!)
  self.dataTask?.resume()
            
  #if os(iOS)
  UIApplication.shared.isNetworkActivityIndicatorVisible = true
  #endif
}

I promise we init Swifter with the ability to choose which DispatchQueue is used

@kyledotmp3 kyledotmp3 changed the title Inject Thread Choice Dictate DispatchQueue Choice at Init Dec 1, 2020
@meteochu
Copy link
Contributor

meteochu commented Dec 3, 2020

I guess this was just always the case since Matt wrote the original Swifter 6 years ago (wow! 6). I don't see why we can't change it to allow for different queues. Feel free to put up a PR

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

No branches or pull requests

2 participants