AvroPayloadCodec
in package
implements
PayloadCodec
FinalYes
Apache Avro implementation of the Durable Workflow payload framing.
Table of Contents
Interfaces
Constants
- GENERIC_PREFIX : mixed = "\x00"
- TYPED_PREFIX : mixed = "\x01"
- WRAPPER_SCHEMA_JSON : mixed = '{"type":"record","name":"Payload","namespace":...
Properties
- $schema : AvroSchema|null
- $wrapperSchema : AvroSchema|null
Methods
- __construct() : mixed
- decode() : mixed
- decodeEnvelope() : mixed
- encode() : string
- envelope() : array{codec: string, blob: string}
- name() : string
- parseSchema() : AvroSchema
- withSchema() : self
- readTypedFrame() : AvroSchema, 1: string}
- schemaJson() : string
- withoutApacheDeprecations() : T
- wrapperSchema() : AvroSchema
Constants
GENERIC_PREFIX
public
mixed
GENERIC_PREFIX
= "\x00"
TYPED_PREFIX
public
mixed
TYPED_PREFIX
= "\x01"
WRAPPER_SCHEMA_JSON
public
mixed
WRAPPER_SCHEMA_JSON
= '{"type":"record","name":"Payload","namespace":"durable_workflow","fields":[{"name":"json","type":"string"},{"name":"version","type":"int","default":1}]}'
Properties
$schema read-only
private
AvroSchema|null
$schema
= null
$wrapperSchema
private
static AvroSchema|null
$wrapperSchema
= null
Methods
__construct()
public
__construct([AvroSchema|null $schema = null ]) : mixed
Parameters
- $schema : AvroSchema|null = null
decode()
public
decode(string $blob) : mixed
Parameters
- $blob : string
decodeEnvelope()
public
decodeEnvelope(array{codec?: mixed, blob?: mixed}|string|null $envelope) : mixed
Parameters
- $envelope : array{codec?: mixed, blob?: mixed}|string|null
encode()
public
encode(mixed $value) : string
Parameters
- $value : mixed
Return values
stringenvelope()
public
envelope(mixed $value) : array{codec: string, blob: string}
Parameters
- $value : mixed
Return values
array{codec: string, blob: string}name()
public
name() : string
Return values
stringparseSchema()
public
static parseSchema(string $schemaJson) : AvroSchema
Parameters
- $schemaJson : string
Return values
AvroSchemawithSchema()
public
withSchema(AvroSchema|string $schema) : self
Parameters
- $schema : AvroSchema|string
Return values
selfreadTypedFrame()
private
static readTypedFrame(string $bytes) : AvroSchema, 1: string}
Parameters
- $bytes : string
Return values
AvroSchema, 1: string}schemaJson()
private
static schemaJson(AvroSchema $schema) : string
Parameters
- $schema : AvroSchema
Return values
stringwithoutApacheDeprecations()
private
static withoutApacheDeprecations(callable(): T $operation) : T
Parameters
- $operation : callable(): T
Tags
Return values
TwrapperSchema()
private
static wrapperSchema() : AvroSchema