Which data structure to throttle outbound messages?

641 views Asked by At

I need to send messages (the actual technology is irrelevant at this stage) while complying with a number of throttling constraints. Basically I have contraints that are related to the sender and to the destination, in terms of messages per second. I don't mind in enforcing the throttling while accepting the messages from the sender, while I do need to throttle them when sending out. I was thinking about priority queues, but maybe there's a better advice.

Anyway, the application is multithreaded, written in C and running under Linux, if this matters.

1

There are 1 answers

0
Hbf On

Take a look at this question and the answers mentioned there:

Throttling method calls to M requests in N seconds