Open jonathonmcmurray opened 5 years ago
Needs to be added to documentation as well
@jonathonmcmurray did you get this going in https://github.com/jonathonmcmurray/reQ/commit/8c9305446c5fcb859dfbefd825c30ef20b8ce1fa ? Any blockers? Would be highly interested in seeing this ship
@n1koo yes, initial version of this is in 8c93054 - haven't had time to work on this further, or document it properly but in essence args are similar to http://jmcmurray.co.uk/reQ/internal/#reqsend except added "timeout" arg at start (& no "verbose" flag at end)
Note that this is a pretty hacky workaround using the 0
handle, which will probably break on any process using slaves.
I don't plan on making a new "release" in the short term (there are a few other features I want in place before next release), but the changes are on master branch if you wish to use that?
Perfect, will give it a go 👍
Most HTTP clients implement timeout functionality for slow responding servers. In q, the
-T
cmd line arg or\T
command can set a timeout for remotely executed commands, which we can use to timeout a local command by sending it to ourselves over handle0
e.g.As an initial version, I'll implement a wrapper that
(i) sets timeout (ii) performs request (with error trap) over handle
0
(iii) resets timeout (iv) signals if timeout was hitFuture rewrites may allow a more sophisticated approach.