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

Async, Background, and Local Dispatchers support #81

Open
JoshuaBrest opened this issue Apr 27, 2023 · 4 comments
Open

Async, Background, and Local Dispatchers support #81

JoshuaBrest opened this issue Apr 27, 2023 · 4 comments
Labels
question Further information is requested theoretical

Comments

@JoshuaBrest
Copy link
Contributor

JoshuaBrest commented Apr 27, 2023

I think we should add the following features to make development easier:

  • Async
    • Maybe you need to call async functions
    • Could be done by calling a background task to modify the view later instead of in the did_load
  • Background
    • Maybe a background task might be useful for like setInterval
  • Local Dispatcher
    • So that instead of adding complicated logic in App, you can do it in the local view impl
@madsmtm
Copy link
Contributor

madsmtm commented Apr 27, 2023

See some of the previous discussion on this in madsmtm/objc2#279.

In short: async Objective-C is difficult, and especially difficult to make efficient!

@ryanmcgrath
Copy link
Owner

I'm neither for nor against this conceptually, but I think I'd ultimately defer to anything @madsmtm does upstream in objc2 - which cacao needs to ultimately rebase on and finally merge anyway.

We can keep this open as a general tracking issue and I'll label it accordingly, but don't expect much for some time.

@ryanmcgrath ryanmcgrath added question Further information is requested theoretical labels Apr 28, 2023
@JoshuaBrest JoshuaBrest changed the title No Async Support Async, Background, and Local Dispatchers support May 8, 2023
@JoshuaBrest
Copy link
Contributor Author

For the local dispatcher, i think it would be possible if we added lifetimes or just used unsafe. It should be fine if we unregister the fn,

@JoshuaBrest
Copy link
Contributor Author

@ryanmcgrath As I was discovering about objc it turns out the handlers are called in a different whole context where memory in the main thread is not even accessible from a rust fn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested theoretical
Projects
None yet
Development

No branches or pull requests

3 participants