I’m sending messages inside a Heartbeat:
This has not behaved well. Apparently, it’s not a good idea to use MessagingService | Roblox Creator Documentation inside Heartbeat, right?
Besides that, there are limitations imposed on MessagingService:
So I think that to get around this, I should create a queuing system, where the number of messages sent per minute is limited.
Is this approach correct?
If yes, is there already a current queuing system for this problem?
To get around this, only send events when you need to.
If you need real-time streaming, try 1 message per second (or two). However, remember that this won’t scale well: 10 game servers means 10 messages per second being sent 90 times, and 100 game servers mean 100 messages per second being sent 900 times (and so on and so forth).
That’s what I’m doing. I’m sending a kind of ‘email’ to the player during the game. A player can get many e-mails at once, depending on the case, which is determined by the clock (that’s why I’m sending it inside Heartbeat).
But my question is actually 2:
- Is wrong to use MessagingService:PublishAsync inside Heartbeat?
- Should I have to create a queuing system to control the number os messages sent per minute?
No, if you’re not sending events every heartbeat and no, because players should be rate limited on sending messages anyway.
I’m confused. Are you polling other servers for messages? That doesn’t seem very efficient.