natscli icon indicating copy to clipboard operation
natscli copied to clipboard

Ability to set infinite timeout

Open udf2457 opened this issue 2 years ago • 1 comments

Would be nice if there was a way to set infinite timeout, --timeout=0 exits immediately and --timeout=-1 is an invalid option (similar for --count).

This would be useful for a couple of reasons:

  • Allow simulation similar to an infinitewhile() loop
  • Allow better testing of retries, for example one nats instance with --no-ack and then waiting for retry timeout

Yes, arguably you could set a long timeout, but something like -1 = infinite would be "cleaner" and more deterministic (and obvious when writing docs).

udf2457 avatar Aug 21 '23 18:08 udf2457

Suggest you just set a big one. Infinite timeout is usually a bad idea and will lead to issues.

ripienaar avatar Aug 21 '23 18:08 ripienaar