bdw429s
07/15/2022, 7:36 PMonTimeout
convention, but I'd just as soon see that sort of thing added to cfthread directly. Precedent in the language however would make me want the timeout to raise an exception to match tags like cflock'd default behavior.dswitzer
07/15/2022, 7:42 PMbdw429s
07/15/2022, 7:47 PMnot having to try and "join" the thread to wait for it to complete.This is a valid point. The cftimeout tag is sync by nature. Here is the implementation https://github.com/lucee/Lucee/commit/27139ca38af10d5ac5bad32368311e683aa720e3#diff-5fb0077d519dcc3a7c896817c960[…]9cb81da2cd8799cb96cbfdb2349265R87
bdw429s
07/15/2022, 7:48 PMI suspect this still waits for external processes (like queries) to finish before timing out,@dswitzer If you're saying it won't timeout properly when there is native code still running, that is not the case. The cftimeout tag basically runs the code in a thread, so it can simply give up and allow the parent thread to continue regardless of the status of the code inside of that thread.
bdw429s
07/15/2022, 7:49 PMbdw429s
07/15/2022, 7:51 PMtimeout=seconds
than a timespan=createTimeSpan(...)
implemented. mostly because the realistic use case for this is going to be seconds, not hours, or days.bdw429s
07/15/2022, 7:52 PMtimeout timespan=0.001 {
sleep(1000);
}
Where 0.001
is 1 one thousandth of a single day. That's crap IMO. (A timespan is really just an integer equaling how many days. 1 = 1 day)dswitzer
07/15/2022, 7:52 PMbdw429s
07/15/2022, 7:55 PMbdw429s
07/15/2022, 7:55 PMbdw429s
07/15/2022, 7:57 PMdswitzer
07/15/2022, 8:00 PMtimeout
wouldn't be in (milli)secounds. The timeout
is usually in seconds for other tags/functions, so that would make sense to keep in that way.