KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Process requests before continuing with script Reply To: Process requests before continuing with script

  • rocuinneagain

    Member
    August 6, 2024 at 10:46 am

    You can use a timer and wrap the rest of the code in a function.

    h:(); .z.po:{h,:x};
    {system "q ",x," -p 0W &"} each ("feed1.q";"feed2.q");
    .z.ts:{if[2=count h;system"t 0";main[]]}
    \t 1000
    main:{[] show "Rest of code" }

    Or move the code out to a different file and only load that once the handles are open:

    h:(); .z.po:{h,:x};
    {system "q ",x," -p 0W &"} each ("feed1.q";"feed2.q");
    .z.ts:{if[2=count h;system"t 0";system"l main.q"]}
    \t 1000