by Acconut on 11/4/17, 10:18 AM with 65 comments
by tidwall on 11/4/17, 2:23 PM
You would not want to use this framework if you need to handle long-running requests (milliseconds or more). For example, a web api that needs to connect to a mongo database, authenticate, and respond; just use the Go net/http package instead.
There are many popular event loop based applications in the wild such as Nginx, Haproxy, Redis, and Memcached. All of these are single-threaded and very fast and written in C.
The reason I wrote this framework is so I can build certain network services that perform like the C apps above, but I also want to continue to work in Go.
by crawshaw on 11/4/17, 12:00 PM
That is, I can write simple blocking code, and my server still scales.
Using event loop programming in Go would take away one of my favorite things about the language, so I won't be using this. However I do appreciate the work, as it makes an excellent bug report against the Go runtime. It gives us a standard to hold the standard library's net package to.
by olivierva on 11/4/17, 11:32 AM
by fooyc on 11/4/17, 11:59 AM
by indescions_2017 on 11/4/17, 1:52 PM
It's a testament to what is possible through the "syscall" and "golang/x/sys" facilities. As well as your confidence in playing with Linux internals ;)
by bsaul on 11/4/17, 12:32 PM
Stripping those mechanism to pretend the event handling is faster only works if you never intend to have some real computation performed. That's never true in practice... Or am i missing something ?
by brian-armstrong on 11/4/17, 7:02 PM
by adrianratnapala on 11/4/17, 1:57 PM
by cdoxsey on 11/4/17, 8:27 PM
The single-threaded nature of applications liked Redis an Haproxy is a singificant impediment to their vertical scalability. CPUs aren't getting faster, we're just going to get more cores, so anything that assumes there's only a single core seems like a dead end.
Haproxy literally just added multithreading support in 1.8.