setRequestedMaxFrequency method
Setter method that sets the maximum update frequency to be requested to Lightstreamer Server for all the items in the Subscription.
It can be used only if the Subscription mode is MERGE, DISTINCT or
COMMAND (in the latter case, the frequency limitation applies to the
UPDATE events for each single key). For Subscriptions with two-level behavior
(see Subscription.setCommandSecondLevelFields and Subscription.setCommandSecondLevelFieldSchema)
, the specified frequency limit applies to both first-level and second-level items.
Note that frequency limits on the items can also be set on the
server side and this request can only be issued in order to further
reduce the frequency, not to rise it beyond these limits.
This method can also be used to request unfiltered dispatching
for the items in the Subscription. However, unfiltered dispatching
requests may be refused if any frequency limit is posed on the server
side for some item.
General Edition Note A further global frequency limit could also be imposed by the Server, depending on Edition and License Type; this specific limit also applies to RAW mode and to unfiltered dispatching. To know what features are enabled by your license, please see the License tab of the Monitoring Dashboard (by default, available at /dashboard).
Default null, meaning to lean on the Server default based on the subscription mode. This consists, for all modes, in not applying any frequency limit to the subscription (the same as "unlimited"); see the "General Concepts" document for further details.
Lifecycle This method can can be called at any time with some differences based on the Subscription status:
- If the Subscription instance is in its "inactive" state then this method can be called at will.
- If the Subscription instance is in its "active" state then the method can still be called unless the current value is "unfiltered" or the supplied value is "unfiltered" or null. If the Subscription instance is in its "active" state and the connection to the server is currently open, then a request to change the frequency of the Subscription on the fly is sent to the server.
Throws IllegalStateException if the Subscription is currently "active" and the current value of this property is "unfiltered".
Throws IllegalStateException if the Subscription is currently "active" and the given parameter is null or "unfiltered".
Throws IllegalArgumentException if the specified value is not null nor one of the special "unlimited" and "unfiltered" values nor a valid positive number.
freq
A decimal number, representing the maximum update frequency (expressed in updates per second) for each item in the Subscription; for instance, with a setting of 0.5, for each single item, no more than one update every 2 seconds will be received. If the string "unlimited" is supplied, then no frequency limit is requested. It is also possible to supply the string "unfiltered", to ask for unfiltered dispatching, if it is allowed for the items, or a null value to stick to the Server default (which currently corresponds to "unlimited"). The check for the string constants is case insensitive.
Implementation
Future<void> setRequestedMaxFrequency(String? freq) async {
_requestedMaxFrequency = freq;
if (_remoteActive) {
var arguments = <String, dynamic> {
'newVal': freq
};
return await _invokeMethod('setRequestedMaxFrequency', arguments);
}
}