Replies: 1 comment 4 replies
-
Why is this a problem? Performance? Ease of reading the code? Something else?
Why is this an argument in favour of adding timeout? I still believe that the correct semantics are that deadline or timeout indicate how long you are willing to wait for |
Beta Was this translation helpful? Give feedback.
-
Following #1111, I think it is possible to add a SetTimeout or ReadTimeout API to rigbuf
I saw there was some discussion about this in the past here #523 (comment)
The reason behind adding the timeout option is to avoid re-setting the deadline before each read, which is the scenario today
In case I want to call
Read()
and I'm willing for it to block for max of 5 seconds for example, I'll have to re-do theSetDeadline(time.now().add...)
With a timeout API it will save this. In addition, the epoll syscall takes a timeout argument as mentioned in the above mentioned discussion
If you agree, I'll be happy to add this (might need to define how timeout is working when deadline is also possible and when each option is taken)
Beta Was this translation helpful? Give feedback.
All reactions