UnityMessageThrottler class
Message throttler for rate-limited communication.
Limits the rate of messages sent to Unity to prevent overwhelming the communication channel.
Example:
final throttler = UnityMessageThrottler(controller);
// Configure rate limit (60 messages per second)
throttler.setRate('Player:position', 60);
// Send throttled messages
throttler.send('Player', 'position', data); // Rate limited
Constructors
- UnityMessageThrottler(UnityController _controller)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
flush(
) → Future< void> - Flush any pending throttled messages.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
String target, String method, dynamic data) → Future< void> - Send a message with throttling.
-
setRate(
String key, int messagesPerSecond, {ThrottleStrategy strategy = ThrottleStrategy.keepLatest}) → void - Set rate limit for a target:method combination.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited