Skip to content

Commit

Permalink
Make all shutdown and force_flush methods async
Browse files Browse the repository at this point in the history
  • Loading branch information
jjatria committed Nov 23, 2023
1 parent 170809b commit f03af81
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Revision history for OpenTelemetry-Exporter-OTLP

* Bump Object::Pad dependency to 0.74 to ensure
support for field initialisers
* Make all shutdown and force_flush methods async.
This adds a new dependency on Future::AsyncAwait

0.013 2023-11-21 23:19:28+00:00 Europe/London

Expand Down
1 change: 1 addition & 0 deletions META.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"requires" : {
"Feature::Compat::Try" : "0",
"File::Share" : "0",
"Future::AsyncAwait" : "0.38",
"HTTP::Tiny" : "0",
"JSON::MaybeXS" : "0",
"Metrics::Any" : "0",
Expand Down
2 changes: 2 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ my %WriteMakefileArgs = (
"PREREQ_PM" => {
"Feature::Compat::Try" => 0,
"File::Share" => 0,
"Future::AsyncAwait" => "0.38",
"HTTP::Tiny" => 0,
"JSON::MaybeXS" => 0,
"Metrics::Any" => 0,
Expand Down Expand Up @@ -54,6 +55,7 @@ my %FallbackPrereqs = (
"Feature::Compat::Try" => 0,
"File::Share" => 0,
"File::Spec" => 0,
"Future::AsyncAwait" => "0.38",
"HTTP::Tiny" => 0,
"JSON::MaybeXS" => 0,
"Metrics::Any" => 0,
Expand Down
1 change: 1 addition & 0 deletions cpanfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
requires 'Feature::Compat::Try';
requires 'Future::AsyncAwait', '0.38'; # Object::Pad compatibility
requires 'File::Share';
requires 'HTTP::Tiny';
requires 'JSON::MaybeXS';
Expand Down
5 changes: 3 additions & 2 deletions lib/OpenTelemetry/Exporter/OTLP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ our $VERSION = '0.014';

class OpenTelemetry::Exporter::OTLP :does(OpenTelemetry::Exporter) {
use Feature::Compat::Try;
use Future::AsyncAwait;
use HTTP::Tiny;
use Module::Runtime 'require_module';
use OpenTelemetry::Common qw( config maybe_timeout timeout_timestamp );
Expand Down Expand Up @@ -307,12 +308,12 @@ class OpenTelemetry::Exporter::OTLP :does(OpenTelemetry::Exporter) {
$self->$send_request( $request, $timeout );
}

method shutdown ( $timeout = undef ) {
async method shutdown ( $timeout = undef ) {
$stopped = 1;
TRACE_EXPORT_SUCCESS;
}

method force_flush ( $timeout = undef ) {
async method force_flush ( $timeout = undef ) {
TRACE_EXPORT_SUCCESS;
}
}

0 comments on commit f03af81

Please sign in to comment.