-
-
12 Feb 2021 14:41:22 UTC
- Distribution: OpenTracing-Interface
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (0)
- Testers
- Kwalitee
Bus factor: 2- 78.25% Coverage
- License: artistic_2
- Activity
24 month- Tools
- Download (22.7KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Theo van Hoesel (VANHOESEL) <tvanhoesel@perceptyx.com
NAME
OpenTracing::Interface::Scope - A role that defines the Scope interface
SYNOPSIS
package OpenTracing::Implementation::MyBackendService::Scope; sub close { ... } sub get_span { ... } BEGIN { use Role::Tiny::With; with 'OpenTracing::Interface::Scope' } # check at compile time, perl -c will work 1;
DESCRIPTION
This 'role' describes the interface for any OpenTracing Scope implementation.
A
Scope
formalizes the activation and deactivation of aSpan
, usually from a CPU standpoint.Many times a
Span
will be extant (in thatfinish()
has not been called) despite being in a non-runnable state from a CPU/scheduler standpoint. For instance, aSpan
representing the client side of an RPC will be unfinished but blocked on IO while the RPC is still outstanding. AScope
defines when a givenSpan
is scheduled and on the path.INSTANCE METHODS
close
Mark the end of the active period for the current thread and Scope, updating the
ScopeManager::active()
in the process.$scope->close;
NOTE: Calling
close
more than once on a singleScope
instance leads to undefined behavior.- Parameter(s)
-
none
- Returns
-
Invocant
-
The
Scope
instance <$self>, for ease of chaining (although the usefulness is doubtfull).
get_span
Returns the
Span
that's been scoped by thisScope
my $span = $scope->get_span
SEE ALSO
- OpenTracing::Interface
-
Describes the API definition for OpenTransport implementations written in the Perl5 language.
- OpenTracing::Types
-
A library of Type::Tiny type constraints that provides Duck Type checks for all common elements that conform OpenTracing::Interface
CAVEATS
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.
AUTHOR
Theo van Hoesel <tvanhoesel@perceptyx.com>
COPYRIGHT AND LICENSE
'OpenTracing API for Perl' is Copyright (C) 2019 .. 2021, Perceptyx Inc
This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.
This library is distributed in the hope that it will be useful, but it is provided "as is" and without any express or implied warranties.
For details, see the full text of the license in the file LICENSE.
Module Install Instructions
To install OpenTracing::Interface, copy and paste the appropriate command in to your terminal.
cpanm OpenTracing::Interface
perl -MCPAN -e shell install OpenTracing::Interface
For more information on module installation, please visit the detailed CPAN module installation guide.