Skip to content

Commit

Permalink
add: enable read/write concurrency for ets buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
rhblind committed Sep 20, 2024
1 parent 3f504d3 commit 0223a68
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/off_broadway/emqqt/broker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ defmodule OffBroadway.EMQTT.Broker do
# Create a public ETS table to act as message buffer. It needs to be public
# because the Producer process will read directly from it to avoid copying
# the content across processes.
:ets.new(state.ets_table, [:ordered_set, :named_table, :public])
:ets.new(state.ets_table, [
:ordered_set,
:named_table,
:public,
{:read_concurrency, true},
{:write_concurrency, true}
])

{:noreply, state, {:continue, :subscribe_to_topics}}
end

Expand Down

0 comments on commit 0223a68

Please sign in to comment.