2 ms·
> there is literally no way to poll a file descriptor https://godoc.org/golang.org/x/sys https://godoc.org/golang.org/x/sys https://godoc.org/golang.org/x/sys
by eternalban 10y ago
> there is literally no way to poll a file descriptor
https://godoc.org/golang.org/x/sys https://godoc.org/golang.org/x/sys
https://godoc.org/golang.org/x/sys/unix#EpollWait https://godoc.org/golang.org/x/sys/unix#EpollWait
https://golang.org/pkg/syscall/ https://golang.org/pkg/syscall/
Of course it is a bit of a pain to write OS specific variants if you are building a completely crossplatform solution, but it is supported out of the box:
https://dave.cheney.net/2013/10/12/how-to-use-conditional-compilation-with-the-go-build-tool https://dave.cheney.net/2013/10/12/how-to-use-conditional-co...
That said, I agree [regarding the] puzzling decision to not to treat 'select' as a general contract for all asynchronous ops as that fits perfectly with the CSP approach.
- lobster_johnson 10y agoIndeed, though I was referring to select{}, i.e. Go's first-class language constructs.