Hey peeps, 

thank you for your input, I will try these options and see how it goes. 

Regards,
Peter.

On Tuesday 15 October 2024 at 10:12:15 UTC+1 Brian Candler wrote:

> On Monday 14 October 2024 at 22:57:07 UTC+1 Peter Bočan wrote:
>
> What is the recommended way of reading whatever is on the buffer and 
> return back without blocking?
>
>
> If you just want to poll, and get whatever data is available: set a 
> deadline of "just after now", and read.
> https://go.dev/play/p/bFDh7gqpeYc   [Note: doesn't work properly in the 
> playground; I don't know why]
>
> If you want to do other concurrent work and/or select between multiple 
> sources: use a goroutine to read and pass the data down a channel, and 
> closes the channel when done.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0143d8e4-8e4d-460c-acbc-ca1b634f958en%40googlegroups.com.

Reply via email to