- SEE ALSO
OpenTracing::Role::SpanContext - Role for OpenTracing implementations.
package OpenTracing::Implementation::MyBackendService::SpanContext use Moo; ... with 'OpenTracing::Role::SpanContext' 1;
This is a role for OpenTracing implenetations that are compliant with the OpenTracing::Interface.
It has been suggested that an object that implements the OpenTracing SpanContext interface SHOULD be immutable, to avoid lifetime issues. Therefore, the attributes are read/write-protected. Any changes tried to make, will trigger a Sub::Trigger::Lock exception.
Most likely, the new constructor would only be called during the extraction phase. Depending on the framework the OpenTracing implementation is being used for, it will be initialised with request depenent information. From there on, additional bagage-items can be added.
Implementors should be aware of the immutable desired behavbior and should use methods like
with_... to clone this object with new values, rather than just updating any values of the the attributes.
Returns a single value for a given key.
Returns a hash that contains all key/value pairs for the current baggage items. By returning a hash and not a reference, it purposefully makes it hard to mutate any of the key/value pairs in the baggage_items.
Creates a clone of the current object, with new kew/value pair added.
Creates a clone of the current object, with list of kew/value pairs added.