refactor(shared_sub): Export transactions
This commit is contained in:
parent
cd3aa476c6
commit
b962a71da2
|
@ -67,6 +67,11 @@
|
|||
code_change/3
|
||||
]).
|
||||
|
||||
%% Internal exports (RPC)
|
||||
-export([
|
||||
init_monitors/0
|
||||
]).
|
||||
|
||||
-export_type([strategy/0]).
|
||||
|
||||
-type strategy() ::
|
||||
|
@ -336,7 +341,7 @@ subscribers(Group, Topic) ->
|
|||
init([]) ->
|
||||
ok = mria:wait_for_tables([?TAB]),
|
||||
{ok, _} = mnesia:subscribe({table, ?TAB, simple}),
|
||||
{atomic, PMon} = mria:transaction(?SHARED_SUB_SHARD, fun init_monitors/0),
|
||||
{atomic, PMon} = mria:transaction(?SHARED_SUB_SHARD, fun ?MODULE:init_monitors/0),
|
||||
ok = emqx_tables:new(?SHARED_SUBS, [protected, bag]),
|
||||
ok = emqx_tables:new(?ALIVE_SUBS, [protected, set, {read_concurrency, true}]),
|
||||
ok = emqx_tables:new(?SHARED_SUBS_ROUND_ROBIN_COUNTER, [public, set, {write_concurrency, true}]),
|
||||
|
|
Loading…
Reference in New Issue