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

provide async features #1

Open
Emilgardis opened this issue Mar 6, 2022 · 1 comment
Open

provide async features #1

Emilgardis opened this issue Mar 6, 2022 · 1 comment

Comments

@Emilgardis
Copy link
Owner

A feature for hooking into a async environment should be added. This is intended to make querying the is_dirty functions easier, eg. don't poll manually, use await.

This should also ensure thread safety for the functions that "need" to be run on the same thread. I need to figure out what happens if they are not ran on the same thread, and then figure out a way to solve it.

I think the easiest way to solve this is a static in each method, this static stores the thread it was first ran in, and panics/errors if it is run elsewhere. A possibility for this is to then also enable "resetting" the thread id. There has to be prior art for this right? :3

@Emilgardis Emilgardis added this to ToDo in Release v0.1.0 via automation Mar 6, 2022
@Emilgardis Emilgardis removed this from ToDo in Release v0.1.0 Mar 11, 2022
@Emilgardis
Copy link
Owner Author

Emilgardis commented Dec 15, 2023

Maybe the "one thread only" functions can take a &mut NotSendButSync where NotSendButSync: !Send + Sync

T: Sync iff &T: Send, but I dont think the same holds for &mut. Then we can ensure same threadedness (I think)

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

1 participant