nbio
nbio是一个用Go语言实现的事件驱动、非阻塞IO的高性能网络框架,支持百万级并发连接,特别适用于海量连接场景,能显著降低内存和GC开销。
• Copy the embed code to showcase this product on your website
• Share on X to spread the word about this amazing tool
nbio是一个用Go语言实现的事件驱动、非阻塞IO的高性能网络框架,支持百万级并发连接,特别适用于海量连接场景,能显著降低内存和GC开销。
• Copy the embed code to showcase this product on your website
• Share on X to spread the word about this amazing tool
golangpackage mainimport ("fmt""net/http""github.com/lesismal/nbio/nbhttp")func main() {mux := &http.ServeMux{}mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {fmt.Fprintf(w, "hello world")})engine := nbhttp.NewEngine(nbhttp.Config{Network: "tcp",Addrs: []string{"localhost:8080"},Handler: mux,})err := engine.Start()if err != nil {fmt.Printf("nbio.Start failed: %v\n", err)return}defer engine.Stop()<-make(chan int)}
- 后续更新计划:持续维护修复各类bug、简化优化代码,希望未来有档期支持HTTP2.0/3.0。