Den fredag 2 februari 2018 kl. 11:50:43 UTC+1 skrev Jesper Louis Andersen:
>
> A simple solution is to have a channel of type struct{} of some bound, say 
> 10. A process only gives service as long as it can pull a message from the 
> channel.
>

How would i hook in such a channel in the http server? Wouldn't a channel 
of type interface{} be better?
 

> More advanced solutions include handling the channel as a token bucket and 
> regulating it to have a drip-rate.
>

I would prefer simple over complex in this instance.
 

>
> Even more advanced solutions sample your system and slows the drip feed 
> when it is overloaded with resources.
>
> You might also consider pushback and queuing. If you are overloaded, you 
> have to tell the caller to stop sending requests for a while.
>
> Consider using a model such as CoDel (Controlled Delay) on your queues.
>

pushback, queuing and CoDel might be good ideas further down the line for 
my project. I'll keep those in mind, thanks!

// 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