Kameloso.throttleline

Takes one or more lines from the passed buffer and sends them to the server.

Sends to the server in a throttled fashion, based on a simple y = k*x + m graph.

This is so we don't get kicked by the server for spamming, if a lot of lines are to be sent at once.

class Kameloso
throttleline
(
Buffer
)
(
ref Buffer buffer
,
const bool dryRun = false
,
const bool sendFaster = false
,
const bool immediate = false
)

Parameters

buffer Buffer

Buffer instance.

dryRun bool

Whether or not to send anything or just do a dry run, incrementing the graph by Throttle.increment.

sendFaster bool

On Twitch, whether or not we should throttle less and send messages faster. Useful in some situations when rate-limiting is more lax.

immediate bool

Whether or not the line should just be sent straight away, ignoring throttling.

Return Value

Type: auto

The time remaining until the next message may be sent, so that we can reschedule the next server read timeout to happen earlier.