ChannelMessageLimit
Defines a message limit for a specific channel type.
This class specifies the maximum number of messages to keep in memory for channels of a particular type. When the number of messages in a channel exceeds this limit (plus a 30-message buffer), the SDK automatically trims older messages from the in-memory state, keeping only the most recent messages up to the limit.
Example usage:
// Limit messaging channels to 100 messages in memory
ChannelMessageLimit(channelType = "messaging", baseLimit = 1000)
// Limit livestream channels to 50 messages in memory
ChannelMessageLimit(channelType = "livestream", baseLimit = 500)Parameters
The type of the channel for which this limit applies (e.g., "messaging", "livestream", "commerce"). This should match the channel type used when creating channels. Channel types not specified in the configuration will have no message limits applied.
The maximum number of messages to keep in memory for channels of this type. When the message count exceeds baseLimit + 30 (the buffer), the SDK trims messages down to this limit. Must be a positive integer. The 30-message buffer is included to avoid trimming too frequently during normal message flow.