Page 1 of 1

Execute when idle

PostPosted: Thu Jun 09, 2016 08:42
by burli
Is it there a system in minetest to execute low priority functions if the main loop is idle?

It should be able to add a function to a queue and the function is executed at the end of a frame, if the frame is idle. If the frame takes longer it should be possible to skip some frames.

I don't know if minetest.after works like this. As far as i know minetest.after calles the functions, idle or not.

It should be more like this

Minetest.queue(1, function()) where the 1 is the maximum time to wait. If it is possible, the function could be called earlier.

I think this might help minetest to increase the performance

Re: Execute when idle

PostPosted: Thu Jun 09, 2016 09:48
by twoelk
Eek, but
I don't want to be executed for being idle.
I protest in the name of all idledoers.

Re: Execute when idle

PostPosted: Thu Jun 09, 2016 09:52
by burli
twoelk wrote:I don't want to be executed for being idle.

No? But idleness is one of the seven deadly sins ;-)

Re: Execute when idle

PostPosted: Thu Jun 09, 2016 16:35
by Glorfindel
Me either! It's hard enough remembering to check back to make sure I don't starve!
XD