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

feat: Concurrency/Multi-Threading #2983

Closed
joshoconnor89 opened this issue May 25, 2020 · 2 comments
Closed

feat: Concurrency/Multi-Threading #2983

joshoconnor89 opened this issue May 25, 2020 · 2 comments

Comments

@joshoconnor89
Copy link

Feature Request

Ionic version:

[x] 5.x

Describe the Feature Request

Tapping into concurrency. One of the great things about native iOS and Android development is the ability to use background threads. In iOS, we use Grand Central Dispatch. It would be wonderful if there was a way to run javascript on these threads, so that UI isnt blocked. Not sure if this is possible, but if so that would be a GAMECHANGER.

Describe Preferred Solution

Say theres a long running operation on ngOnInit() function. if we had a plugin which we could throw that long running operation (a heavy function) on the background thread, and when its complete, run the completion method on the foreground that would be sweet.

Describe Alternatives

Related Code

//Native iOS code
DispatchQueue.global(qos: .userInitiated).async { [weak self] in
  self?.runLongRunningOperation()
  // 2
  DispatchQueue.main.async { [weak self] in
    // 3
    self?.updateUI()
  }
}

Additional Context

Honestly, if the capacitor team could implement this, it would make Ionic one step over React Native and be a huge gamechanger for devs.

Thank you!

@liamdebeasi liamdebeasi transferred this issue from ionic-team/ionic-framework May 26, 2020
@jcesarmobile
Copy link
Member

Issues tagged with feature request are closed but tracked for👍 reactions to gauge interest.

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants