View Source Nostrum.Shard.Session.Compression behaviour (Nostrum v0.10.0)
A behaviour for compression methods supported by the Discord gateway to implement.
See the modules nested under this behaviour for reference implementations.
Internal module
This module is intended for exclusive usage inside of nostrum, and is documented for completeness and people curious to look behind the covers.
Summary
Callbacks
Create a new compression context that can be passed as an argument to other methods within the behaviour to inflate data or reset the context to a blank state.
Decompress a frame received from Discord over the gateway. Should return an iolist of the decompressed data.
Reset a decompression context to a blank slate, this is useful after a websocket resume has taken place or something similar requiring the reset of the state for a shard.
Callbacks
@callback create_context() :: reference()
Create a new compression context that can be passed as an argument to other methods within the behaviour to inflate data or reset the context to a blank state.
Decompress a frame received from Discord over the gateway. Should return an iolist of the decompressed data.
Reset a decompression context to a blank slate, this is useful after a websocket resume has taken place or something similar requiring the reset of the state for a shard.