From 02deb0fe7c49883110cc35296c9c6fd6a15abc21 Mon Sep 17 00:00:00 2001 From: Luke Kuzmish Date: Sat, 13 Jul 2024 20:38:15 -0400 Subject: [PATCH] custom adapter --- src/AdapterManager.php | 7 ++++--- src/Adapters/EventDispatchingAdapter.php | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 src/Adapters/EventDispatchingAdapter.php diff --git a/src/AdapterManager.php b/src/AdapterManager.php index 97adda4..018bf0d 100644 --- a/src/AdapterManager.php +++ b/src/AdapterManager.php @@ -4,6 +4,7 @@ use Carbon\FactoryImmutable; use Carbon\WrapperClock; +use Cosmastech\LaravelStatsDAdapter\Adapters\EventDispatchingAdapter; use Cosmastech\LaravelStatsDAdapter\Adapters\EventDispatchingStatsRecord; use Cosmastech\StatsDClientAdapter\Adapters\Datadog\DatadogStatsDClientAdapter; use Cosmastech\StatsDClientAdapter\Adapters\InMemory\InMemoryClientAdapter; @@ -183,12 +184,12 @@ protected function createLeagueAdapter(array $config): LeagueStatsDClientAdapter /** * @param array $config - * @return InMemoryClientAdapter + * @return EventDispatchingAdapter * @throws BindingResolutionException */ - protected function createEventAdapter(array $config): InMemoryClientAdapter + protected function createEventAdapter(array $config): EventDispatchingAdapter { - return new InMemoryClientAdapter( + return new EventDispatchingAdapter( $this->getDefaultTags(), new EventDispatchingStatsRecord($this->app->make('events')), clock: $this->getClockImplementation() diff --git a/src/Adapters/EventDispatchingAdapter.php b/src/Adapters/EventDispatchingAdapter.php new file mode 100644 index 0000000..d274c27 --- /dev/null +++ b/src/Adapters/EventDispatchingAdapter.php @@ -0,0 +1,9 @@ +