Sha256: b1e949adca5d048285c265550ea1e8b0698a09be1ff3bb9db9d584240d1b439c

Contents?: true

Size: 843 Bytes

Versions: 13

Compression:

Stored size: 843 Bytes

Contents

$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../..')
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../../lib')

require 'yajl'

obj = {
  :a_test => "of encoding in one pass" * 512,
  :a_test2 => "of encoding in one pass" * 512,
  :a_test3 => "of encoding in one pass" * 512,
  :a_test4 => "of encoding in one pass" * 512,
  :which_will => "simply return a string when finished" * 512,
  :which_will2 => "simply return a string when finished" * 512,
  :which_will3 => "simply return a string when finished" * 512,
  :which_will4 => "simply return a string when finished" * 512,
  :as_easy_as => 123
}

chunks = 0
total_size = 0

Yajl::Encoder.encode(obj) do |chunk|
  chunks += 1
  total_size += chunk.size
  STDOUT << chunk
end

puts "\n\nEncoder generated #{total_size} bytes of data, in #{chunks} chunks"

Version data entries

13 entries across 13 versions & 6 rubygems

Version Path
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/examples/encoding/chunked_encoding.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/examples/encoding/chunked_encoding.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/examples/encoding/chunked_encoding.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/examples/encoding/chunked_encoding.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/yajl-ruby-1.4.3/examples/encoding/chunked_encoding.rb
yajl-ruby-1.4.3 examples/encoding/chunked_encoding.rb
yajl-ruby-1.4.2 examples/encoding/chunked_encoding.rb
yajl-ruby-1.4.1 examples/encoding/chunked_encoding.rb
yajl-ruby-1.4.0 examples/encoding/chunked_encoding.rb
yajl-ruby-1.3.1 examples/encoding/chunked_encoding.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/yajl-ruby-1.3.0/examples/encoding/chunked_encoding.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/yajl-ruby-1.3.0/examples/encoding/chunked_encoding.rb
yajl-ruby-1.3.0 examples/encoding/chunked_encoding.rb