From df1bea27354c0ea268bebb8c7f2bf02e22ef323c Mon Sep 17 00:00:00 2001 From: Bruce Date: Mon, 22 Aug 2022 14:05:55 -0700 Subject: [PATCH] Allow list of events and acknowledge last subscription --- lib/commanded/event_store/extreme.ex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/commanded/event_store/extreme.ex b/lib/commanded/event_store/extreme.ex index bd1c90e..4412528 100644 --- a/lib/commanded/event_store/extreme.ex +++ b/lib/commanded/event_store/extreme.ex @@ -142,6 +142,12 @@ defmodule Commanded.EventStore.Adapters.Extreme do ) end + @impl Commanded.EventStore.Adapter + def ack_event(_adapter_meta, subscription, [%RecordedEvent{} | _rest] = events) do + %RecordedEvent{event_number: event_number} = List.last(events) + Subscription.ack(subscription, event_number) + end + @impl Commanded.EventStore.Adapter def ack_event(_adapter_meta, subscription, %RecordedEvent{event_number: event_number}) do Subscription.ack(subscription, event_number)