2022.11.03 09:07 AM
Hi,
I have a decision tree function and rather than run it recursively and building a stack I'd like to trigger the next execution asyncly. The idea is that when the process is idle it will handle then next branch.
The idea is to have something like this inside the function:
neg[0i] "execute_next[]"
I know neg[0i] doesn't work but is there some internal command that can handle this?
An alternative is to create a FIFO pipe, just curious if there's a way to do this.
2022.11.03 09:25 AM
Not directly, but the .z.ts callback can only run during idle time, and you can set it up such that it will run very soon after your function finishes. It is also possible to use a timer library such as this one that takes care of handling the callback and timeout, so you can set up a relative timer to run in zero milliseconds which has the effect of running your function during idle time.
2022.11.30 09:30 AM
Hi thanks for this. In the end I handled it using converge with async jobs using a callback to trigger the parent jobs. The callback was either timer based or ipc based.
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.