Class: Temporalio::PayloadCodec::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/temporalio/payload_codec/base.rb

Overview

This class is abstract.

Use this Interface for implementing your payload codecs.

Codec for encoding/decoding to/from bytes. Commonly used for compression or encryption.

Instance Method Summary collapse

Instance Method Details

#decode(_payloads) ⇒ Array<Temporalio::Api::Common::V1::Payload>

Decode the given payloads.

Parameters:

Returns:

  • (Array<Temporalio::Api::Common::V1::Payload>)

    Decoded payloads. Note, this does not have to be the same number as payloads given, but must be at least one and cannot be more than was given.

Raises:

  • (NoMethodError)


27
28
29
# File 'lib/temporalio/payload_codec/base.rb', line 27

def decode(_payloads)
  raise NoMethodError, 'must implement #decode'
end

#encode(_payloads) ⇒ Array<Temporalio::Api::Common::V1::Payload>

Encode the given payloads.

Parameters:

Returns:

  • (Array<Temporalio::Api::Common::V1::Payload>)

    Encoded payloads. Note, this does not have to be the same number as payloads given, but must be at least one and cannot be more than was given.

Raises:

  • (NoMethodError)


15
16
17
# File 'lib/temporalio/payload_codec/base.rb', line 15

def encode(_payloads)
  raise NoMethodError, 'must implement #encode'
end