Skip to content

Commit

Permalink
Merge pull request #349 from tom-binary/feature/rpc_dynamic_method
Browse files Browse the repository at this point in the history
Use current instance method for RPC calls
  • Loading branch information
tom-binary authored Oct 15, 2024
2 parents ad2e529 + a3c3a9a commit d2f29f0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Myriad/Service/Implementation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ async method load () {
sink => $sink
);

my $code = $spec->{code};
$spec->{current} = $sink->source->map($self->$curry::weak(async method ($message) {
my $span;
if(USE_OPENTELEMETRY) {
Expand All @@ -333,7 +332,7 @@ async method load () {
if(USE_OPENTELEMETRY) {
my $context = OpenTelemetry::Trace->context_with_span($span);
dynamically OpenTelemetry::Context->current = $context;
my $response = await $self->$code(
my $response = await $self->$method(
$message->args->%*
)->on_ready(sub {
my $f = shift;
Expand All @@ -351,7 +350,7 @@ async method load () {
);
return $res;
} else {
my $response = await $self->$code(
my $response = await $self->$method(
$message->args->%*
)->on_ready(sub {
my $f = shift;
Expand Down

0 comments on commit d2f29f0

Please sign in to comment.