Skip to content

Commit

Permalink
docs: fix test_message and test_batch options (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarcab committed Sep 7, 2023
1 parent d29f1f7 commit ebee2a9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/broadway.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ defmodule Broadway do
|> Topology.ProducerStage.push_messages(messages)
end

test_messages_options_schema = [
test_batch_options_schema = [
metadata: [
type: :any,
default: [],
Expand Down Expand Up @@ -1174,11 +1174,11 @@ defmodule Broadway do
]
]

@test_message_options_schema NimbleOptions.new!(test_messages_options_schema)
@test_batch_options_schema NimbleOptions.new!(test_batch_options_schema)

@test_batch_options_schema test_messages_options_schema
|> Keyword.delete(:batch_mode)
|> NimbleOptions.new!()
@test_message_options_schema test_batch_options_schema
|> Keyword.delete(:batch_mode)
|> NimbleOptions.new!()

@doc """
Sends a test message through the Broadway pipeline.
Expand Down Expand Up @@ -1262,7 +1262,7 @@ defmodule Broadway do
@spec test_batch(broadway :: name(), data :: [term], opts :: Keyword.t()) :: reference
def test_batch(broadway, batch_data, opts \\ [])
when is_broadway_name(broadway) and is_list(batch_data) and is_list(opts) do
opts = NimbleOptions.validate!(opts, @test_message_options_schema)
opts = NimbleOptions.validate!(opts, @test_batch_options_schema)
{batch_mode, opts} = Keyword.pop(opts, :batch_mode, :bulk)
test_messages(broadway, batch_data, batch_mode, opts)
end
Expand Down

0 comments on commit ebee2a9

Please sign in to comment.