News for hackers. Stuff that matters.
Re:Goroutines, Nonblocking I/O, and Memory Usage by mentat on Thursday January 05, 2017 @11:19PM (#13333903)
You can select on the read and an time.After channel which "interrupts" the select for a timeout.
Re:Goroutines, Nonblocking I/O, and Memory Usage by lobster_johnson on Thursday January 05, 2017 @11:27PM (#13333940)
You can't select on a read, though. select{} only works on channels. You can run the read in a separate goroutine, but that doesn't stop the read from happening.
Re:Goroutines, Nonblocking I/O, and Memory Usage by tptacek on Friday January 06, 2017 @08:13PM (#13341780)
You can't use the language "select", but you can call the select(2) system call.
Re:Goroutines, Nonblocking I/O, and Memory Usage by lobster_johnson on Friday January 06, 2017 @08:33PM (#13341867)
Indeed, someone already pointed this out: https://news.ycombinator.com/item?id=13332847.