How to limit method usage per amount of time?

前端 未结 6 1515
南旧
南旧 2020-12-31 08:12

It has to be trivial, but I just cannot get through it. I have to limit amount of tasks (let\'s say connections, emails sent or clicks in the button) per amount of time. So

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-31 08:41

    You can use Rx extensions (How to use the new BufferWithTimeOrCount in Rx that returns IObservable> instead of IObservable>), but I would implement the buffering manually by adding an appropriate proxy object.

提交回复
热议问题