OpenTracing::Interface::Reference - Defines the ContextReference interface
package OpenTracing::Implementation::MyBackendService::Scope; sub new_child_of { ... } sub new_follows_from { ... } sub get_referenced_context { ... } sub type_is_child_of { ... } sub type_is_follows_from { ... } BEGIN { use Role::Tiny::With; with 'OpenTracing::Interface::ContextReference' if $ENV{OPENTRACING_INTERFACE}; } # check at compile time, perl -c will work 1;
This 'role' describes the interface for any OpenTracing ContextReference implementation.
References are used by Tracer methods start_span and start_active_span to create "casual span references"
Tracer
start_span
start_active_span
See OpenTracing References
Creates a SpanContext ContextReference for which type_is_child_of is 'true'.
SpanContext
ContextReference
ContextReference->new_child_of( $span_context );
The SpanContext the returned ContextReference should should refer to.
Must be a SpanContext form OpenTracing::Types.
A newly instantiated ContextReference
Creates a SpanContext ContextReference for which type_is_follows_from is 'true'.
ContextReference->new_follows_from( $span_context );
Returns the original referenced SpanContext.
$span_context = $reference->get_referenced_context;
none
SpanContext being referenced.
Returns 'true' iff the ContextReference is a CHILD_OF type is, most likely, instantiated with the new_child_of constructor.
CHILD_OF
new_child_of
say "I'm a CHILD_OF context reference" if $context_reference->type_is_child_of;
Bool
Returns 'true' iff the ContextReference is a FOLLOWS_FROM type is, most likely, instantiated with the new_follows_from constructor.
FOLLOWS_FROM
new_follows_from
say "I'm a FOLLOWS_FROM context reference" if $context_reference->type_is_child_of;
Describes the API definition for OpenTransport implementations written in the Perl5 language.
A library of Type::Tiny type constraints that provides Duck Type checks for all common elements that conform OpenTracing::Interface
This description is using around method modifiers that basically wraps them around the real implementation. These method modifiers provide a 'readable' and reusable interface, describing the inputs and outputs, using type constraints.
around
Consumers of this role, or implementors of the interface are MUST implement each method mentioned below. Not doing so will result in compilation errors.
Since this role does nothing else than checking input and output, it is useful during development. Most likely it can be switched off safely in production environments.
To install OpenTracing::Interface, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpenTracing::Interface
CPAN shell
perl -MCPAN -e shell install OpenTracing::Interface
For more information on module installation, please visit the detailed CPAN module installation guide.