Documentation
¶
Overview ¶
Package cmdqueue implements a command queueing and execution management system.
Fundamental assumptions:
- We are always ready to accept at least one queued command per channel, for all channels serviced by this instance.
Channel considerations:
- Command acceptance is subject to:
Batch-capable commands
Command-handler is fast and execution is serialized (no parallel calls for the same command)
Always accepted unconditionally
We take the hit on worst-case memory usage
Serialized commands
Async slow commands
- Command output is always rate-limited according to global parameters.
Command output is rate-limited to a 1-second minimum interval for channels, if the channel is not marked as exempt.
Ability to forcefully bypass.
Mode-switching required to maximize output rate? Use token-bucket for burst, then switch to simple limit-per-second while bucket refills + cooldown?
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdQueue ¶
type CmdQueue struct {
// contains filtered or unexported fields
}
func (*CmdQueue) AddCommand ¶
AddCommand enqueues a user-issued command.
func (*CmdQueue) CooldownChannel ¶
func (*CmdQueue) Exec ¶
Exec executes the command queue until the given context is done.
func (*CmdQueue) RemoveChannel ¶
RemoveChannel clears channel state after a PART.