If i define a webserver as such (taken from the docs)

http.Handle("/foo", fooHandler)

http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) {
        fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))

log.Fatal(http.ListenAndServe(":8080", nil))

How do i control how many simultaneous requests my server may handle?

As i understand it, the handlers get spawned off as separate go routines. 
I'm looking for a way to limit the number of such go routines.

I would like to limit the effects of getting a massive storm of requests in 
a short amount of time which might chew up all RAM/CPU.

// Patrik

You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to