Skip to content

Commit

Permalink
📝 subscriber: Add some more TODOs for future me
Browse files Browse the repository at this point in the history
  • Loading branch information
alexocode committed Jan 12, 2024
1 parent ccdfacb commit 5971ad9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Batching:
☐ Introduce a Subscriber.Simple behaviour that is used by the generated default implementation
☐ Refactor Subscriber.Generic to handle batching
☐ Refactor Adapter.Local to send batched messages

Expand Down
1 change: 1 addition & 0 deletions lib/gazet/subscriber.ex
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ defmodule Gazet.Subscriber do

@impl Gazet.Subscriber
def handle_batch(topic, batch, context) do
# TODO: Refactor this to rely on a `Subscriber.Simple` behaviour
Enum.reduce_while(batch, :ok, fn {message, metadata}, _ ->
with {:error, reason} <- handle_message(topic, message, metadata, context),
{:error, reason} <- handle_error(reason, topic, message, metadata, context) do
Expand Down

0 comments on commit 5971ad9

Please sign in to comment.