- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
start_link(Shard, Subscriber) ->
gen_server:start_link(?MODULE, {server, Shard, Subscriber}, []).
start_link_client(Shard, RemoteNode, Parent) ->
gen_server:start_link(?MODULE, {client, Shard, RemoteNode, Parent}, []).
init({server, Shard, Subscriber}) ->
{ok, #server{ shard = Shard
, subscriber = Subscriber
}};
init({client, Shard, RemoteNode, Parent}) ->
{ok, #client{ parent = Parent
, shard = Shard
}}.