Module: ActiveSupport::MessagePack::Serializer
Do not use. This module is for internal use only.
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Extended In:
| |
|
Included In:
| |
| Defined in: | activesupport/lib/active_support/message_pack/serializer.rb |
Constant Summary
-
SIGNATURE =
# File 'activesupport/lib/active_support/message_pack/serializer.rb', line 9
128.to_msgpack
"\xCC\x80".b.freeze
-
SIGNATURE_INT =
# File 'activesupport/lib/active_support/message_pack/serializer.rb', line 10128
Instance Attribute Summary
- #message_pack_factory rw
- #message_pack_factory=(factory) rw
- #register_type readonly
Instance Method Summary
Instance Attribute Details
#message_pack_factory (rw)
[ GitHub ]# File 'activesupport/lib/active_support/message_pack/serializer.rb', line 32
def @message_pack_factory ||= ::MessagePack::Factory.new end
#message_pack_factory=(factory) (rw)
[ GitHub ]# File 'activesupport/lib/active_support/message_pack/serializer.rb', line 36
def (factory) @message_pack_pool = nil @message_pack_factory = factory end
#register_type (readonly)
[ GitHub ]# File 'activesupport/lib/active_support/message_pack/serializer.rb', line 41
delegate :register_type, to: :
Instance Method Details
#dump(object)
[ GitHub ]# File 'activesupport/lib/active_support/message_pack/serializer.rb', line 12
def dump(object) .packer do |packer| packer.write(SIGNATURE_INT) packer.write(object) packer.full_pack end end
#install_unregistered_type_handler (private)
[ GitHub ]# File 'activesupport/lib/active_support/message_pack/serializer.rb', line 59
def install_unregistered_type_handler Extensions.install_unregistered_type_error() end
#load(dumped)
[ GitHub ]# File 'activesupport/lib/active_support/message_pack/serializer.rb', line 20
def load(dumped) .unpacker do |unpacker| unpacker.feed_reference(dumped) raise "Invalid serialization format" unless unpacker.read == SIGNATURE_INT unpacker.full_unpack end end
#message_pack_pool (private)
[ GitHub ]# File 'activesupport/lib/active_support/message_pack/serializer.rb', line 48
def @message_pack_pool ||= begin unless .frozen? Extensions.install() install_unregistered_type_handler .freeze end .pool(ENV.fetch("RAILS_MAX_THREADS", 5).to_i) end end
#signature?(dumped) ⇒ Boolean
#warmup
[ GitHub ]# File 'activesupport/lib/active_support/message_pack/serializer.rb', line 43
def warmup # eagerly compute end