How to limit number of HttpWebRequest per second towards a webserver?

前端 未结 3 1453
日久生厌
日久生厌 2021-02-09 05:37

I need to implement a throttling mechanism (requests per second) when using HttpWebRequest for making parallel requests towards one application server. My C# app must issue no m

3条回答
  •  情书的邮戳
    2021-02-09 06:33

    The Throttle() and Sample() extension methods (On Observable) allow you to regulate a fast sequence of events into a "slower" sequence.

    Here is a blog post with an example of Sample(Timespan) that ensures a maxium rate.

提交回复
热议问题