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

Event Loop Integration #95

Open
Aidan63 opened this issue Jul 20, 2024 · 0 comments
Open

Event Loop Integration #95

Aidan63 opened this issue Jul 20, 2024 · 0 comments

Comments

@Aidan63
Copy link
Owner

Aidan63 commented Jul 20, 2024

Whats the relationship between asys and the thread event loop? I was debugging an issue from how I've integrated the two but then realised I've made the assumption that they're related. E.g. is the following expected to work?

Thread.create(() -> {
	asys.native.filesystem.FileSystem.openFile('foo.txt', Read, (_, _) -> {
		trace('complete');
	});
});

In my implementation this throws an exception as it piggy backs off the thread event loop, which Thread.create doesn't have. Is it expected that this should work? If so how should the current thread event loop and the asys event loop work together.
If the above should work then should there be a change in haxe 5 for threads to always have an event loop? I'm not sure if there was a specific need for a thread without an event loop outside of precautions in case it would break things.

This sort of event loop integration was briefly mentioned in the coroutines PR, so there might be a lot of overlap here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant