News for hackers. Stuff that matters.
Re:SetBigTimeout by sjaak on Friday October 18, 2024 @12:19PM (#41880845)
What is the use-case for such a function?
Re:SetBigTimeout by echoangle on Friday October 18, 2024 @12:20PM (#41880863)
Make a joke and have something to write a blogpost about, while letting your readers learn something new.
Re:SetBigTimeout by keithwhor on Friday October 18, 2024 @12:22PM (#41880877)
Off the top of my head, a cron scheduler for a server that reads from a database and sets a timeout upon boot. Every time the server is reboot the timeouts are reinitialized (fail safe in case of downtime). If upon boot there’s a timeout > 25 days it’ll get executed immediately which is not the behavior you want.
Re:SetBigTimeout by hinkley on Friday October 18, 2024 @02:52PM (#41882349)
This should be an interval with a lookup.

Every five seconds check for due dates sooner than 10 seconds from now and schedule them.

The longer a delay the higher the odds the process exits without finishing the work.

Re:SetBigTimeout by skykooler on Friday October 18, 2024 @01:49PM (#41881778)
Why would you do that in JS rather than just using cron for it?
Re:SetBigTimeout by efilife on Sunday October 20, 2024 @08:50AM (#41895034)
It can be quicker since you are in the environment already and you are sure that they will activate only when your program is running
Re:SetBigTimeout by bgirard on Friday October 18, 2024 @12:39PM (#41881064)
Not having your timeout fire unexpectedly instantly is a good use-case IMO.