Skip to content

Instantly share code, notes, and snippets.

@softberries
Created March 21, 2023 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save softberries/cfe46adf002a4ce9aaaf96e06769102a to your computer and use it in GitHub Desktop.
Save softberries/cfe46adf002a4ce9aaaf96e06769102a to your computer and use it in GitHub Desktop.
defmodule MyBroadway do
use Broadway
alias Broadway.Message
def start_link(_opts) do
Broadway.start_link(__MODULE__,
name: __MODULE__,
producer: [
# producer configuration
],
processors: [
# processor configuration
],
batchers: [
# batchers configuration
]
)
end
def handle_message(_processor_name, message, _context) do
....
end
def handle_batch(_batch, messages, _batch_info, _context) do
.....
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment