Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mentat
on Jan 6, 2017
|
parent
|
context
|
favorite
| on:
Goroutines, Nonblocking I/O, and Memory Usage
You can select on the read and an time.After channel which "interrupts" the select for a timeout.
atombender
on Jan 6, 2017
[–]
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.
tptacek
on Jan 7, 2017
|
parent
[–]
You can't use the language "select", but you can call the select(2) system call.
atombender
on Jan 7, 2017
|
root
|
parent
[–]
Indeed, someone already pointed this out:
https://news.ycombinator.com/item?id=13332847
.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: