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

Change server update loop from NoWait to Default #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

inert-aesthetic
Copy link

Change reduces idle CPU usage by a large amount. (100% to 0%)

Needs testing.

I have confirmed only that POST and GET requests with plain text still work.

Change reduces idle CPU usage by a large amount. (100% to 0%)
@Frixuu
Copy link
Contributor

Frixuu commented Sep 26, 2024

One issue is that LoopRunMode.Default prevents users from returning from the listen method (param blocking:Bool):

function main() {
	new weblink.Weblink().listen(2000, false);
	trace("hello!"); // isn't called with this patch
}

Also, because MainLoop/Thread.events are not integrated with the libuv loop, I do not expect any timers will be ran either.

@PXshadow
Copy link
Owner

One issue is that LoopRunMode.Default prevents users from returning from the listen method (param blocking:Bool):

function main() {
	new weblink.Weblink().listen(2000, false);
	trace("hello!"); // isn't called with this patch
}

Also, because MainLoop/Thread.events are not integrated with the libuv loop, I do not expect any timers will be ran either.

Maybe we could build out a system to run the timers using a background thread for the Haxe std. I know for example Heaps.io has to handle the haxe.Timer system as well as openFL instead of the std, where as targets such as JS work out of the box.

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

Successfully merging this pull request may close these issues.

3 participants