Flow PHP

W3CBaggage implements Propagator

Read onlyYes
FinalYes

W3C Baggage propagator for propagating application-specific data.

Implements the W3C Baggage specification for propagating key-value pairs across service boundaries using HTTP headers.

Header format: baggage: key1=value1,key2=value2;property1;property2=propValue

Note: Properties (metadata for baggage entries) are parsed but not preserved in the current implementation as they are rarely used.

Example usage:

$propagator = new W3CBaggage();

// Extract from incoming request
$carrier = new ArrayCarrier($headers);
$ctx = $propagator->extract($carrier);
$baggage = $ctx->baggage;

// Inject into outgoing request
$carrier = new ArrayCarrier();
$propagator->inject(new PropagationContext(baggage: $baggage), $carrier);
$headers = $carrier->toArray();
Tags
see
https://www.w3.org/TR/baggage/

Interfaces

Propagator
Interface for propagating context across process boundaries.

Constants

HEADER_BAGGAGE  = 'baggage'

Methods

extract()  : PropagationContext
Extract context from a carrier.
fields()  : array<string|int, string>
Get the list of header/field names this propagator uses.
inject()  : void
Inject context into a carrier.

Constants

HEADER_BAGGAGE

public mixed HEADER_BAGGAGE = 'baggage'

Methods

fields()

Get the list of header/field names this propagator uses.

public fields() : array<string|int, string>
Return values
array<string|int, string>

        
On this page

Search results