Skip to content

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