Module: NNQ::Zstd
- Defined in:
- lib/nnq/zstd.rb,
lib/nnq/zstd.rb,
lib/nnq/zstd/codec.rb,
lib/nnq/zstd/version.rb,
lib/nnq/zstd/wrapper.rb
Defined Under Namespace
Classes: Codec, ProtocolError, Wrapper
Constant Summary collapse
- RESERVED_DICT_ID_LOW_MAX =
32_767- RESERVED_DICT_ID_HIGH_MIN =
2**31
- USER_DICT_ID_RANGE =
(32_768..(2**31 - 1)).freeze
- VERSION =
"0.1.0"
Class Method Summary collapse
-
.wrap(socket, level: -3,, dict: nil) ⇒ Object
Wraps an NNQ::Socket with transparent Zstd compression.
Class Method Details
.wrap(socket, level: -3,, dict: nil) ⇒ Object
Wraps an NNQ::Socket with transparent Zstd compression.
Both peers must wrap their sockets; there is no negotiation. See RFC.md for the wire protocol.
A receive-only “passive” decoder needs no special flag — wrap the socket and just never call ‘send`. Training is driven by outbound traffic, so a socket that only receives naturally skips training and dict shipping.
41 42 43 |
# File 'lib/nnq/zstd.rb', line 41 def self.wrap(socket, level: -3, dict: nil) Wrapper.new(socket, level: level, dicts: Array(dict).compact) end |