Sha256: ea9e94bbe9ae0ddf2e659e3594bed8cccb51da91f7d2147b7c47a0d9e3f27ad3

Contents?: true

Size: 460 Bytes

Versions: 18

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true

module Kafka
  class ZstdCodec
    def codec_id
      4
    end

    def produce_api_min_version
      7
    end

    def load
      require "zstd-ruby"
    rescue LoadError
      raise LoadError, "using zstd compression requires adding a dependency on the `zstd-ruby` gem to your Gemfile."
    end

    def compress(data)
      Zstd.compress(data)
    end

    def decompress(data)
      Zstd.decompress(data)
    end
  end
end

Version data entries

18 entries across 18 versions & 3 rubygems

Version Path
ruby-kafka-1.5.0 lib/kafka/zstd_codec.rb
ruby-kafka-aws-iam-1.4.5 lib/kafka/zstd_codec.rb
ruby-kafka-aws-iam-1.4.4 lib/kafka/zstd_codec.rb
ruby-kafka-aws-iam-1.4.3 lib/kafka/zstd_codec.rb
ruby-kafka-aws-iam-1.4.2 lib/kafka/zstd_codec.rb
ruby-kafka-aws-iam-1.4.1 lib/kafka/zstd_codec.rb
ruby-kafka-1.4.0 lib/kafka/zstd_codec.rb
ruby-kafka-temp-fork-0.0.2 lib/kafka/zstd_codec.rb
ruby-kafka-temp-fork-0.0.1 lib/kafka/zstd_codec.rb
ruby-kafka-1.3.0 lib/kafka/zstd_codec.rb
ruby-kafka-1.2.0 lib/kafka/zstd_codec.rb
ruby-kafka-1.1.0 lib/kafka/zstd_codec.rb
ruby-kafka-1.1.0.beta1 lib/kafka/zstd_codec.rb
ruby-kafka-1.0.0 lib/kafka/zstd_codec.rb
ruby-kafka-0.7.10 lib/kafka/zstd_codec.rb
ruby-kafka-0.7.9 lib/kafka/zstd_codec.rb
ruby-kafka-0.7.8 lib/kafka/zstd_codec.rb
ruby-kafka-0.7.7 lib/kafka/zstd_codec.rb