Class: Synapse::Serialization::SerializedObjectCache Private
- Inherits:
-
Object
- Object
- Synapse::Serialization::SerializedObjectCache
- Defined in:
- lib/synapse/serialization/message/serialized_object_cache.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Thread-safe cache for messages to store serialized metadata and payload
Instance Method Summary collapse
- #initialize(message) ⇒ undefined constructor private
- #serialize_metadata(serializer, expected_type) ⇒ SerializedObject private
- #serialize_payload(serializer, expected_type) ⇒ SerializedObject private
Constructor Details
#initialize(message) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 11 12 13 |
# File 'lib/synapse/serialization/message/serialized_object_cache.rb', line 8 def initialize() @message = @lock = Mutex.new @metadata_cache = Hash.new @payload_cache = Hash.new end |
Instance Method Details
#serialize_metadata(serializer, expected_type) ⇒ SerializedObject
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 |
# File 'lib/synapse/serialization/message/serialized_object_cache.rb', line 18 def (serializer, expected_type) serialize @message., @metadata_cache, serializer, expected_type end |
#serialize_payload(serializer, expected_type) ⇒ SerializedObject
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/synapse/serialization/message/serialized_object_cache.rb', line 25 def serialize_payload(serializer, expected_type) serialize @message.payload, @payload_cache, serializer, expected_type end |