[undertow-dev] Download Bandwidth Throttling Handler

Stuart Douglas sdouglas at redhat.com
Sun Aug 31 19:41:02 EDT 2014



ralf_boogie_blues at bluewin.ch wrote:
> Hi
>
> I am looking for a handler that throttles downloads to a configurable
> download rate. As far as I can see, there is no such handler yet available.
> I can find good solution based on servlets but I would like to solve
> this requirement with a undertow handler.
>
> How difficult is it implement such a handler? May you can give just a
> little hint and I could proceed. That would be great.

Unfortunately it is fairly technical, as you need to provide a 
StreamSinkCoduit implementation that achieves this. These conduits 
support both blocking and non-blocking IO.

The blocking side of things is fairly easy (if the data limit is 
exceeded just block for a while), however the non-blocking side of 
things is a bit more technical (basically when the limit is exceeded you 
return 0 and register a timer to notify the conduit when it can write 
again).

Feel free to have ago at implementing this, or you can just file a JIRA 
and I will try and get to it some time this week.

Stuart

>
> Ralf
>
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev


More information about the undertow-dev mailing list