| 1 | package ForgeOps::Tracker::SpanDelivery; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | # Adapts Client->deliver_spans to the deliver() method DeliveryQueue's worker thread calls, so | ||
| 7 | # finished traces reuse that queue (its bound, its lazy thread start, its per-item error guard) | ||
| 8 | # instead of a second copy of it. | ||
| 9 | sub new { | ||
| 10 | my ($class, $client) = @_; | ||
| 11 | return bless { client => $client }, $class; | ||
| 12 | } | ||
| 13 | |||
| 14 | sub deliver { | ||
| 15 | my ($self, $trace) = @_; | ||
| 16 | return $self->{client}->deliver_spans($trace); | ||
| 17 | } | ||
| 18 | |||
| 19 | 1; |