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.

struct Kameloso
throttleline
(
Buffer
)
(
ref Buffer buffer
,
const Flag!"dryRun" dryRun = No.dryRun
,
const Flag!"sendFaster" sendFaster = No.sendFaster
,
const Flag!"immediate" immediate = No.immediate
)

Parameters

Buffer

Buffer type, generally lu.container.Buffer.

buffer Buffer

Buffer instance.

dryRun Flag!"dryRun"

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

sendFaster Flag!"sendFaster"

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

immediate Flag!"immediate"

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.

Meta