When do MessagingService limits reset?

I’m writing a script using the MessagingService and I cannot figure out how to rate limit my requests.

Basically I’m trying to figure out when MessagingService limits are reset.

I’d assume they reset similar to one of the following:
PublishAsync() > requests++ > wait(60) > requests--
PublishAsync() > requests++ AND while true > wait(60) > requests = 0

I’m not sure which determines how limits are reset and thus I am not sure how to keep track of my budget and prevent myself from going over the limit/slow down requests.

My goal is to have a main loop which sends requests and then a few functions which will fire requests based on live occurences. If the functions are called too frequently I’d like to slow down my loop/slow down requests and if the limit is hit I’d like to wait for request space so I won’t lose requests.

The limitation of the MessagingServer is per minute, that means that the limit should be reset when 1 minute passes, here is the complete table:

Messages per game server per minute: 150 + 60 * number of players.
Subscriptions per game server: 5 + 2 * number of players

Hopefully this clears out any confusion.

This is available on the documentation page already. This doesn’t clear up anything for me. “x requests per minute” doesn’t say how it is reset.

If you read my post I stated the two ways I believed it could work.

1 Like