Browse Source

Add docs.

Roberto Ostinelli 3 years ago
parent
commit
1ada714b9e
4 changed files with 535 additions and 413 deletions
  1. 2 0
      README.md
  2. 272 159
      src/syn.erl
  3. 30 23
      src/syn_groups.erl
  4. 231 231
      test/syn_groups_SUITE.erl

+ 2 - 0
README.md

@@ -2,6 +2,8 @@
 **Syn** (short for _synonym_) is a global Process Registry and Process Group manager for Erlang and Elixir.
 **Syn** (short for _synonym_) is a global Process Registry and Process Group manager for Erlang and Elixir.
 Syn automatically manages dynamic clusters (addition / removal of nodes), and is also able to recover from net splits.
 Syn automatically manages dynamic clusters (addition / removal of nodes), and is also able to recover from net splits.
 
 
+[Documentation](https://hexdocs.pm/telemetry/)
+
 ## Introduction
 ## Introduction
 
 
 ### What is a Process Registry?
 ### What is a Process Registry?

+ 272 - 159
src/syn.erl

@@ -64,10 +64,10 @@
 -export([is_local_member/2, is_local_member/3]).
 -export([is_local_member/2, is_local_member/3]).
 -export([join/2, join/3, join/4]).
 -export([join/2, join/3, join/4]).
 -export([leave/2, leave/3]).
 -export([leave/2, leave/3]).
--export([groups_count/0, groups_count/1, groups_count/2]).
--export([local_groups_count/0, local_groups_count/1]).
--export([groups_names/0, groups_names/1, groups_names/2]).
--export([local_groups_names/0, local_groups_names/1]).
+-export([group_count/0, group_count/1, group_count/2]).
+-export([local_group_count/0, local_group_count/1]).
+-export([group_names/0, group_names/1, group_names/2]).
+-export([local_group_names/0, local_group_names/1]).
 -export([publish/2, publish/3]).
 -export([publish/2, publish/3]).
 -export([local_publish/2, local_publish/3]).
 -export([local_publish/2, local_publish/3]).
 -export([multi_call/2, multi_call/3, multi_call/4, multi_call_reply/2]).
 -export([multi_call/2, multi_call/3, multi_call/4, multi_call_reply/2]).
@@ -95,29 +95,15 @@ stop() ->
 node_scopes() ->
 node_scopes() ->
     syn_sup:node_scopes().
     syn_sup:node_scopes().
 
 
-%% @doc Add the local node to the specified Scope.
+%% @doc Add the local node to the specified `Scope'.
 %%
 %%
 %% <h2>Examples</h2>
 %% <h2>Examples</h2>
 %% The following adds the local node to the scope "devices" and then register a process handling a device in that scope:
 %% The following adds the local node to the scope "devices" and then register a process handling a device in that scope:
-%% <h3>Elixir</h3>
-%% ```
-%% iex> :syn.add_node_to_scope(:devices)
-%% :ok
-%% iex> :syn.register(:devices, "hedy", self())
-%% :ok
-%% '''
-%% <h3>Erlang</h3>
-%% ```
-%% 1> syn:add_node_to_scope(devices).
-%% ok
-%% 2> syn:register(devices, "SN-123-456789", self()).
-%% ok
-%% '''
 -spec add_node_to_scope(Scope :: atom()) -> ok.
 -spec add_node_to_scope(Scope :: atom()) -> ok.
 add_node_to_scope(Scope) ->
 add_node_to_scope(Scope) ->
     syn_sup:add_node_to_scope(Scope).
     syn_sup:add_node_to_scope(Scope).
 
 
-%% @doc Add the local node to the specified Scopes.
+%% @doc Add the local node to the specified `Scope's.
 -spec add_node_to_scopes(Scopes :: [atom()]) -> ok.
 -spec add_node_to_scopes(Scopes :: [atom()]) -> ok.
 add_node_to_scopes(Scopes) ->
 add_node_to_scopes(Scopes) ->
     lists:foreach(fun(Scope) ->
     lists:foreach(fun(Scope) ->
@@ -146,44 +132,64 @@ set_event_handler(Module) ->
 %% ----- \/ registry -------------------------------------------------
 %% ----- \/ registry -------------------------------------------------
 %% @doc Looks up a registry entry in the `default' scope.
 %% @doc Looks up a registry entry in the `default' scope.
 %%
 %%
-%% Same as `lookup(default, Name)'.
--spec lookup(Name :: any()) -> {pid(), Meta :: any()} | undefined.
-lookup(Name) ->
-    syn_registry:lookup(Name).
-
-%% @doc Looks up a registry entry in the specified Scope.
+%% Same as calling `lookup(default, Name)', see {@link lookup/2}.
 %%
 %%
 %% <h2>Examples</h2>
 %% <h2>Examples</h2>
 %% <h3>Elixir</h3>
 %% <h3>Elixir</h3>
 %% ```
 %% ```
-%% iex> :syn.lookup(:devices, "SN-123-456789")
+%% iex> :syn.register("SN-123-456789", self())
+%% :ok
+%% iex> :syn.lookup("SN-123-456789")
 %% {#PID<0.105.0>, undefined}
 %% {#PID<0.105.0>, undefined}
 %% '''
 %% '''
 %% <h3>Erlang</h3>
 %% <h3>Erlang</h3>
 %% ```
 %% ```
-%% 1> syn:lookup(devices, "SN-123-456789").
+%% 1> syn:register("SN-123-456789", self()).
+%% ok
+%% 2> syn:lookup(devices, "SN-123-456789").
 %% {<0.79.0>, undefined}
 %% {<0.79.0>, undefined}
 %% '''
 %% '''
+-spec lookup(Name :: any()) -> {pid(), Meta :: any()} | undefined.
+lookup(Name) ->
+    syn_registry:lookup(Name).
+
+%% @doc Looks up a registry entry in the specified `Scope'.
 -spec lookup(Scope :: atom(), Name :: any()) -> {pid(), Meta :: any()} | undefined.
 -spec lookup(Scope :: atom(), Name :: any()) -> {pid(), Meta :: any()} | undefined.
 lookup(Scope, Name) ->
 lookup(Scope, Name) ->
     syn_registry:lookup(Scope, Name).
     syn_registry:lookup(Scope, Name).
 
 
 %% @doc Registers a process in the `default' scope.
 %% @doc Registers a process in the `default' scope.
 %%
 %%
-%% Same as `register(default, Name, Pid, undefined)'.
+%% Same as calling `register(default, Name, Pid, undefined)', see {@link register/4}.
+%%
+%% <h2>Examples</h2>
+%% <h3>Elixir</h3>
+%% ```
+%% iex> :syn.register("SN-123-456789", self())
+%% :ok
+%% iex> :syn.lookup("SN-123-456789")
+%% {#PID<0.105.0>, undefined}
+%% '''
+%% <h3>Erlang</h3>
+%% ```
+%% 1> syn:register("SN-123-456789", self()).
+%% ok
+%% 2> syn:lookup(devices, "SN-123-456789").
+%% {<0.79.0>, undefined}
+%% '''
 -spec register(Name :: any(), Pid :: pid()) -> ok | {error, Reason :: any()}.
 -spec register(Name :: any(), Pid :: pid()) -> ok | {error, Reason :: any()}.
 register(Name, Pid) ->
 register(Name, Pid) ->
     syn_registry:register(Name, Pid).
     syn_registry:register(Name, Pid).
 
 
-%% @doc Registers a process with metadata in the `default' scope OR with undefined metadata in the specified Scope.
+%% @doc Registers a process with metadata in the `default' scope OR with undefined metadata in the specified `Scope'.
 %%
 %%
-%% Same as `register(default, Name, Pid, Meta)' or `register(Scope, Name, Pid, undefined)'
-%% depending on the position of the `pid()' value.
+%% Same as calling `register(default, Name, Pid, Meta)' or `register(Scope, Name, Pid, undefined)'
+%% depending on the position of the `pid()' value. See {@link register/4} for more info.
 -spec register(NameOrScope :: any(), PidOrName :: any(), MetaOrPid :: any()) -> ok | {error, Reason :: any()}.
 -spec register(NameOrScope :: any(), PidOrName :: any(), MetaOrPid :: any()) -> ok | {error, Reason :: any()}.
 register(NameOrScope, PidOrName, MetaOrPid) ->
 register(NameOrScope, PidOrName, MetaOrPid) ->
     syn_registry:register(NameOrScope, PidOrName, MetaOrPid).
     syn_registry:register(NameOrScope, PidOrName, MetaOrPid).
 
 
-%% @doc Registers a process with metadata in the specified Scope.
+%% @doc Registers a process with metadata in the specified `Scope'.
 %%
 %%
 %% Possible error reasons:
 %% Possible error reasons:
 %% <ul>
 %% <ul>
@@ -200,21 +206,29 @@ register(NameOrScope, PidOrName, MetaOrPid) ->
 %% <h2>Examples</h2>
 %% <h2>Examples</h2>
 %% <h3>Elixir</h3>
 %% <h3>Elixir</h3>
 %% ```
 %% ```
+%% iex> :syn.add_node_to_scope(:devices).
+%% :ok
 %% iex> :syn.register(:devices, "SN-123-456789", self(), [meta: :one])
 %% iex> :syn.register(:devices, "SN-123-456789", self(), [meta: :one])
 %% :ok
 %% :ok
+%% iex> :syn.lookup(:devices, "SN-123-456789")
+%% {#PID<0.105.0>, [meta: :one]}
 %% '''
 %% '''
 %% ```
 %% ```
 %% iex> tuple = {:via, :syn, <<"your process name">>}.
 %% iex> tuple = {:via, :syn, <<"your process name">>}.
 %% :ok
 %% :ok
 %% iex> GenServer.start_link(__MODULE__, [], name: tuple)
 %% iex> GenServer.start_link(__MODULE__, [], name: tuple)
 %% {ok, #PID<0.105.0>}
 %% {ok, #PID<0.105.0>}
-%% iex> GenServer.call(tuple, your_message).
-%% your_message
+%% iex> GenServer.call(tuple, :your_message).
+%% :your_message
 %% '''
 %% '''
 %% <h3>Erlang</h3>
 %% <h3>Erlang</h3>
 %% ```
 %% ```
-%% 1> syn:register(devices, "SN-123-456789", self(), [{meta, one}]).
+%% 1> syn:add_node_to_scope(devices).
+%% ok
+%% 2> syn:register(devices, "SN-123-456789", self(), [{meta, one}]).
 %% ok
 %% ok
+%% 3> syn:lookup(devices, "SN-123-456789").
+%% {<0.79.0>, [{meta, one}]}
 %% '''
 %% '''
 %% ```
 %% ```
 %% 1> Tuple = {via, syn, <<"your process name">>}.
 %% 1> Tuple = {via, syn, <<"your process name">>}.
@@ -230,7 +244,7 @@ register(Scope, Name, Pid, Meta) ->
 
 
 %% @doc Unregisters a process.
 %% @doc Unregisters a process.
 %%
 %%
-%% Same as `unregister(default, Name)'.
+%% Same as calling `unregister(default, Name)', see {@link unregister/2}.
 -spec unregister(Name :: any()) -> ok | {error, Reason :: any()}.
 -spec unregister(Name :: any()) -> ok | {error, Reason :: any()}.
 unregister(Name) ->
 unregister(Name) ->
     syn_registry:unregister(Name).
     syn_registry:unregister(Name).
@@ -245,73 +259,49 @@ unregister(Name) ->
 %%
 %%
 %% You don't need to unregister names of processes that are about to die, since they are monitored by Syn
 %% You don't need to unregister names of processes that are about to die, since they are monitored by Syn
 %% and they will be removed automatically. If you manually unregister a process before it dies, the Syn callbacks will not be called.
 %% and they will be removed automatically. If you manually unregister a process before it dies, the Syn callbacks will not be called.
-%%
-%% <h2>Examples</h2>
-%% <h3>Elixir</h3>
-%% ```
-%% iex> :syn.unregister(:devices, "SN-123-456789")
-%% :ok
-%% '''
-%% <h3>Erlang</h3>
-%% ```
-%% 1> syn:unregister(devices, "SN-123-456789").
-%% ok
-%% '''
 -spec unregister(Scope :: atom(), Name :: any()) -> ok | {error, Reason :: any()}.
 -spec unregister(Scope :: atom(), Name :: any()) -> ok | {error, Reason :: any()}.
 unregister(Scope, Name) ->
 unregister(Scope, Name) ->
     syn_registry:unregister(Scope, Name).
     syn_registry:unregister(Scope, Name).
 
 
 %% @doc Returns the count of all registered processes for the `default' scope.
 %% @doc Returns the count of all registered processes for the `default' scope.
 %%
 %%
-%% Same as `registry_count(default)'.
--spec registry_count() -> non_neg_integer().
-registry_count() ->
-    syn_registry:count().
-
-%% @doc Returns the count of all registered processes for the specified Scope.
+%% Same as calling `registry_count(default)', see {@link registry_count/1}.
 %%
 %%
 %% <h2>Examples</h2>
 %% <h2>Examples</h2>
 %% <h3>Elixir</h3>
 %% <h3>Elixir</h3>
 %% ```
 %% ```
-%% iex> :syn.registry_count(:devices)
+%% iex> :syn.registry_count()
 %% 512473
 %% 512473
 %% '''
 %% '''
 %% <h3>Erlang</h3>
 %% <h3>Erlang</h3>
 %% ```
 %% ```
-%% 1> syn:registry_count(devices).
+%% 1> syn:registry_count().
 %% 512473
 %% 512473
 %% '''
 %% '''
+-spec registry_count() -> non_neg_integer().
+registry_count() ->
+    syn_registry:count().
+
+%% @doc Returns the count of all registered processes for the specified `Scope'.
 -spec registry_count(Scope :: atom()) -> non_neg_integer().
 -spec registry_count(Scope :: atom()) -> non_neg_integer().
 registry_count(Scope) ->
 registry_count(Scope) ->
     syn_registry:count(Scope).
     syn_registry:count(Scope).
 
 
-%% @doc Returns the count of all registered processes for the specified Scope running on a node.
-%%
-%% <h2>Examples</h2>
-%% <h3>Elixir</h3>
-%% ```
-%% iex> :syn.registry_count(:devices, :"two@example.com")
-%% 128902
-%% '''
-%% <h3>Erlang</h3>
-%% ```
-%% 1> syn:registry_count(devices, 'two@example.com').
-%% 128902
-%% '''
+%% @doc Returns the count of all registered processes for the specified `Scope' running on a node.
 -spec registry_count(Scope :: atom(), Node :: node()) -> non_neg_integer().
 -spec registry_count(Scope :: atom(), Node :: node()) -> non_neg_integer().
 registry_count(Scope, Node) ->
 registry_count(Scope, Node) ->
     syn_registry:count(Scope, Node).
     syn_registry:count(Scope, Node).
 
 
 %% @doc Returns the count of all registered processes for the `default' scope running on the local node.
 %% @doc Returns the count of all registered processes for the `default' scope running on the local node.
 %%
 %%
-%% Same as `registry_count(default, node())'.
+%% Same as calling `registry_count(default, node())', see {@link registry_count/2}.
 -spec local_registry_count() -> non_neg_integer().
 -spec local_registry_count() -> non_neg_integer().
 local_registry_count() ->
 local_registry_count() ->
     syn_registry:local_count().
     syn_registry:local_count().
 
 
-%% @doc Returns the count of all registered processes for the specified Scope running on the local node.
+%% @doc Returns the count of all registered processes for the specified `Scope' running on the local node.
 %%
 %%
-%% Same as `registry_count(Scope, node())'.
+%% Same as calling `registry_count(Scope, node())', see {@link registry_count/2}.
 -spec local_registry_count(Scope :: atom()) -> non_neg_integer().
 -spec local_registry_count(Scope :: atom()) -> non_neg_integer().
 local_registry_count(Scope) ->
 local_registry_count(Scope) ->
     syn_registry:local_count(Scope).
     syn_registry:local_count(Scope).
@@ -351,26 +341,46 @@ send(Name, Message) ->
 %% ----- \/ groups ---------------------------------------------------
 %% ----- \/ groups ---------------------------------------------------
 %% @doc Returns the list of all members for GroupName in the `default' Scope.
 %% @doc Returns the list of all members for GroupName in the `default' Scope.
 %%
 %%
-%% Same as `members(default, GroupName)'.
+%% Same as calling `members(default, GroupName)', see {@link members/2}.
+%%
+%% <h2>Examples</h2>
+%% <h3>Elixir</h3>
+%% ```
+%% iex> :syn.join("area-1").
+%% :ok
+%% iex> :syn.members("area-1").
+%% [{#PID<0.105.0>, :undefined}]
+%% '''
+%% <h3>Erlang</h3>
+%% ```
+%% 1> syn:join("area-1", self()).
+%% ok
+%% 2> syn:members("area-1").
+%% [{<0.69.0>, undefined}]
+%% '''
 -spec members(GroupName :: term()) -> [{Pid :: pid(), Meta :: term()}].
 -spec members(GroupName :: term()) -> [{Pid :: pid(), Meta :: term()}].
 members(GroupName) ->
 members(GroupName) ->
     syn_groups:members(GroupName).
     syn_groups:members(GroupName).
 
 
-%% @doc Returns the list of all members for GroupName in the specified Scope.
+%% @doc Returns the list of all members for GroupName in the specified `Scope'.
 %%
 %%
 %% <h2>Examples</h2>
 %% <h2>Examples</h2>
 %% <h3>Elixir</h3>
 %% <h3>Elixir</h3>
 %% ```
 %% ```
-%% iex> :syn.join(:devices, "area-1", self()).
+%% iex> :syn.add_node_to_scope(:devices)
+%% :ok
+%% iex> :syn.join(:devices, "area-1").
 %% :ok
 %% :ok
 %% iex> :syn.members(:devices, "area-1").
 %% iex> :syn.members(:devices, "area-1").
 %% [{#PID<0.105.0>, :undefined}]
 %% [{#PID<0.105.0>, :undefined}]
-%%%% '''
+%% '''
 %% <h3>Erlang</h3>
 %% <h3>Erlang</h3>
 %% ```
 %% ```
-%% 1> syn:join(devices, "area-1", self()).
+%% 1> syn:add_node_to_scope(devices)
+%% ok
+%% 2> syn:join(devices, "area-1", self()).
 %% ok
 %% ok
-%% 2> syn:members(devices, "area-1").
+%% 3> syn:members(devices, "area-1").
 %% [{<0.69.0>, undefined}]
 %% [{<0.69.0>, undefined}]
 %% '''
 %% '''
 -spec members(Scope :: atom(), GroupName :: term()) -> [{Pid :: pid(), Meta :: term()}].
 -spec members(Scope :: atom(), GroupName :: term()) -> [{Pid :: pid(), Meta :: term()}].
@@ -379,59 +389,71 @@ members(Scope, GroupName) ->
 
 
 %% @doc Returns whether a `pid()' is a member of GroupName in the `default' scope.
 %% @doc Returns whether a `pid()' is a member of GroupName in the `default' scope.
 %%
 %%
-%% Same as `is_member(default, GroupName, Pid)'.
+%% Same as calling `is_member(default, GroupName, Pid)', see {@link is_member/3}.
 -spec is_member(GroupName :: any(), Pid :: pid()) -> boolean().
 -spec is_member(GroupName :: any(), Pid :: pid()) -> boolean().
 is_member(GroupName, Pid) ->
 is_member(GroupName, Pid) ->
     syn_groups:is_member(GroupName, Pid).
     syn_groups:is_member(GroupName, Pid).
 
 
-%% @doc Returns whether a `pid()' is a member of GroupName in the specified Scope.
+%% @doc Returns whether a `pid()' is a member of GroupName in the specified `Scope'.
 %%
 %%
-%% This method will raise a `error({invalid_scope, Scope})' if the node has not been added to the specified Scope.
+%% This method will raise a `error({invalid_scope, Scope})' if the node has not been added to the specified `Scope'.
 -spec is_member(Scope :: atom(), GroupName :: any(), Pid :: pid()) -> boolean().
 -spec is_member(Scope :: atom(), GroupName :: any(), Pid :: pid()) -> boolean().
 is_member(Scope, GroupName, Pid) ->
 is_member(Scope, GroupName, Pid) ->
     syn_groups:is_member(Scope, GroupName, Pid).
     syn_groups:is_member(Scope, GroupName, Pid).
 
 
 %% @doc Returns the list of all members for GroupName in the `default' scope running on the local node.
 %% @doc Returns the list of all members for GroupName in the `default' scope running on the local node.
 %%
 %%
-%% Same as `local_members(default, GroupName)'.
+%% Same as calling `local_members(default, GroupName)', see {@link local_members/2}.
 -spec local_members(GroupName :: term()) -> [{Pid :: pid(), Meta :: term()}].
 -spec local_members(GroupName :: term()) -> [{Pid :: pid(), Meta :: term()}].
 local_members(GroupName) ->
 local_members(GroupName) ->
     syn_groups:local_members(GroupName).
     syn_groups:local_members(GroupName).
 
 
-%% @doc Returns the list of all members for GroupName in the specified Scope running on the local node.
+%% @doc Returns the list of all members for GroupName in the specified `Scope' running on the local node.
 %%
 %%
-%% This method will raise a `error({invalid_scope, Scope})' if the node has not been added to the specified Scope.
+%% This method will raise a `error({invalid_scope, Scope})' if the node has not been added to the specified `Scope'.
 -spec local_members(Scope :: atom(), GroupName :: term()) -> [{Pid :: pid(), Meta :: term()}].
 -spec local_members(Scope :: atom(), GroupName :: term()) -> [{Pid :: pid(), Meta :: term()}].
 local_members(Scope, GroupName) ->
 local_members(Scope, GroupName) ->
     syn_groups:local_members(Scope, GroupName).
     syn_groups:local_members(Scope, GroupName).
 
 
 %% @doc Returns whether a `pid()' is a member of GroupName in the `default' scope running on the local node.
 %% @doc Returns whether a `pid()' is a member of GroupName in the `default' scope running on the local node.
 %%
 %%
-%% Same as `is_local_member(default, GroupName, Pid)'.
+%% Same as calling `is_local_member(default, GroupName, Pid)', see {@link is_local_member/3}.
 -spec is_local_member(GroupName :: any(), Pid :: pid()) -> boolean().
 -spec is_local_member(GroupName :: any(), Pid :: pid()) -> boolean().
 is_local_member(GroupName, Pid) ->
 is_local_member(GroupName, Pid) ->
     syn_groups:is_local_member(GroupName, Pid).
     syn_groups:is_local_member(GroupName, Pid).
 
 
-%% @doc Returns whether a `pid()' is a member of GroupName in the specified Scope running on the local node.
+%% @doc Returns whether a `pid()' is a member of GroupName in the specified `Scope' running on the local node.
 %%
 %%
-%% This method will raise a `error({invalid_scope, Scope})' if the node has not been added to the specified Scope.
+%% This method will raise a `error({invalid_scope, Scope})' if the node has not been added to the specified `Scope'.
 -spec is_local_member(Scope :: atom(), GroupName :: any(), Pid :: pid()) -> boolean().
 -spec is_local_member(Scope :: atom(), GroupName :: any(), Pid :: pid()) -> boolean().
 is_local_member(Scope, GroupName, Pid) ->
 is_local_member(Scope, GroupName, Pid) ->
     syn_groups:is_local_member(Scope, GroupName, Pid).
     syn_groups:is_local_member(Scope, GroupName, Pid).
 
 
 %% @doc Adds a `pid()' to GroupName in the `default' scope.
 %% @doc Adds a `pid()' to GroupName in the `default' scope.
 %%
 %%
-%% Same as `join(default, GroupName, Pid)'.
+%% Same as calling `join(default, GroupName, Pid)', see {@link join/4}.
+%%
+%% <h2>Examples</h2>
+%% <h3>Elixir</h3>
+%% ```
+%% iex> :syn.join(:"area-1", self()).
+%% :ok
+%% '''
+%% <h3>Erlang</h3>
+%% ```
+%% 1> syn:join("area-1", self()).
+%% ok
+%% '''
 -spec join(GroupName :: any(), Pid :: pid()) -> ok | {error, Reason :: any()}.
 -spec join(GroupName :: any(), Pid :: pid()) -> ok | {error, Reason :: any()}.
 join(GroupName, Pid) ->
 join(GroupName, Pid) ->
     syn_groups:join(GroupName, Pid).
     syn_groups:join(GroupName, Pid).
 
 
-%% @doc Adds a `pid()' with metadata to GroupName in the `default' scope OR with undefined metadata in the specified Scope.
+%% @doc Adds a `pid()' with metadata to GroupName in the `default' scope OR with undefined metadata in the specified `Scope'.
 -spec join(GroupNameOrScope :: any(), PidOrGroupName :: any(), MetaOrPid :: any()) -> ok | {error, Reason :: any()}.
 -spec join(GroupNameOrScope :: any(), PidOrGroupName :: any(), MetaOrPid :: any()) -> ok | {error, Reason :: any()}.
 join(GroupNameOrScope, PidOrGroupName, MetaOrPid) ->
 join(GroupNameOrScope, PidOrGroupName, MetaOrPid) ->
     syn_groups:join(GroupNameOrScope, PidOrGroupName, MetaOrPid).
     syn_groups:join(GroupNameOrScope, PidOrGroupName, MetaOrPid).
 
 
-%% @doc Adds a `pid()' with metadata to GroupName in the specified Scope.
+%% @doc Adds a `pid()' with metadata to GroupName in the specified `Scope'.
 %%
 %%
 %% Possible error reasons:
 %% Possible error reasons:
 %% <ul>
 %% <ul>
@@ -445,12 +467,16 @@ join(GroupNameOrScope, PidOrGroupName, MetaOrPid) ->
 %% <h2>Examples</h2>
 %% <h2>Examples</h2>
 %% <h3>Elixir</h3>
 %% <h3>Elixir</h3>
 %% ```
 %% ```
+%% iex> :syn.add_node_to_scope(:devices)
+%% :ok
 %% iex> :syn.join(:devices, "area-1", self(), [meta: :one]).
 %% iex> :syn.join(:devices, "area-1", self(), [meta: :one]).
 %% :ok
 %% :ok
-%%%% '''
+%% '''
 %% <h3>Erlang</h3>
 %% <h3>Erlang</h3>
 %% ```
 %% ```
-%% 1> syn:join(devices, "area-1", self(), [{meta, one}]).
+%% 1> syn:add_node_to_scope(devices).
+%% ok
+%% 2> syn:join(devices, "area-1", self(), [{meta, one}]).
 %% ok
 %% ok
 %% '''
 %% '''
 -spec join(Scope :: atom(), GroupName :: any(), Pid :: pid(), Meta :: any()) -> ok | {error, Reason :: any()}.
 -spec join(Scope :: atom(), GroupName :: any(), Pid :: pid(), Meta :: any()) -> ok | {error, Reason :: any()}.
@@ -459,145 +485,232 @@ join(Scope, GroupName, Pid, Meta) ->
 
 
 %% @doc Removes a `pid()' from GroupName in the `default' Scope.
 %% @doc Removes a `pid()' from GroupName in the `default' Scope.
 %%
 %%
-%% Same as `leave(default, GroupName, Pid)'.
+%% Same as calling `leave(default, GroupName, Pid)', see {@link leave/3}.
 -spec leave(GroupName :: any(), Pid :: pid()) -> ok | {error, Reason :: any()}.
 -spec leave(GroupName :: any(), Pid :: pid()) -> ok | {error, Reason :: any()}.
 leave(GroupName, Pid) ->
 leave(GroupName, Pid) ->
     syn_groups:leave(GroupName, Pid).
     syn_groups:leave(GroupName, Pid).
 
 
-%% @doc Removes a `pid()' from GroupName in the specified Scope.
+%% @doc Removes a `pid()' from GroupName in the specified `Scope'.
 %%
 %%
 %% Possible error reasons:
 %% Possible error reasons:
 %% <ul>
 %% <ul>
-%% <li>`not_in_group': The `pid()' is not in GroupName for the specified Scope.</li>
+%% <li>`not_in_group': The `pid()' is not in GroupName for the specified `Scope'.</li>
 %% </ul>
 %% </ul>
 %%
 %%
 %% You don't need to remove processes that are about to die, since they are monitored by Syn and they will be removed
 %% You don't need to remove processes that are about to die, since they are monitored by Syn and they will be removed
 %% automatically from their groups.
 %% automatically from their groups.
-%%
-%% <h2>Examples</h2>
-%% <h3>Elixir</h3>
-%% ```
-%% iex> :syn.leave(:devices, "area-1", self()).
-%% :ok
-%%%% '''
-%% <h3>Erlang</h3>
-%% ```
-%% 1> syn:leave(devices, "area-1", self()).
-%% ok
-%% '''
 -spec leave(Scope :: atom(), GroupName :: any(), Pid :: pid()) -> ok | {error, Reason :: any()}.
 -spec leave(Scope :: atom(), GroupName :: any(), Pid :: pid()) -> ok | {error, Reason :: any()}.
 leave(Scope, GroupName, Pid) ->
 leave(Scope, GroupName, Pid) ->
     syn_groups:leave(Scope, GroupName, Pid).
     syn_groups:leave(Scope, GroupName, Pid).
 
 
 %% @doc Returns the count of all the groups for the `default' scope.
 %% @doc Returns the count of all the groups for the `default' scope.
 %%
 %%
-%% Same as `groups_count(default)'.
--spec groups_count() -> non_neg_integer().
-groups_count() ->
-    syn_groups:count().
-
-%% @doc Returns the count of all the groups for the specified Scope.
+%% Same as calling `group_count(default)', see {@link group_count/1}.
 %%
 %%
 %% <h2>Examples</h2>
 %% <h2>Examples</h2>
 %% <h3>Elixir</h3>
 %% <h3>Elixir</h3>
 %% ```
 %% ```
-%% iex> :syn.groups_count(:devices)
+%% iex> :syn.group_count()
 %% 321778
 %% 321778
 %% '''
 %% '''
 %% <h3>Erlang</h3>
 %% <h3>Erlang</h3>
 %% ```
 %% ```
-%% 1> syn:groups_count(devices).
+%% 1> syn:group_count().
 %% 321778
 %% 321778
 %% '''
 %% '''
--spec groups_count(Scope :: atom()) -> non_neg_integer().
-groups_count(Scope) ->
+-spec group_count() -> non_neg_integer().
+group_count() ->
+    syn_groups:count().
+
+%% @doc Returns the count of all the groups for the specified `Scope'.
+-spec group_count(Scope :: atom()) -> non_neg_integer().
+group_count(Scope) ->
     syn_groups:count(Scope).
     syn_groups:count(Scope).
 
 
-%% @doc Returns the count of all the groups for the specified Scope which have at least 1 process running
-%% on Node.
+%% @doc Returns the count of all the groups for the specified `Scope' which have at least 1 process running on `Node'.
+-spec group_count(Scope :: atom(), Node :: node()) -> non_neg_integer().
+group_count(Scope, Node) ->
+    syn_groups:count(Scope, Node).
+
+%% @doc Returns the count of all the groups which have at least 1 process running on `Node' for the `default' scope.
+%%
+%% Same as calling `group_count(default, node())', see {@link group_count/2}.
+-spec local_group_count() -> non_neg_integer().
+local_group_count() ->
+    syn_groups:local_count().
+
+%% @doc Returns the count of all the groups which have at least 1 process running on `Node' for the specified `Scope'.
+%%
+%% Same as calling `group_count(Scope, node())', see {@link group_count/2}.
+-spec local_group_count(Scope :: atom()) -> non_neg_integer().
+local_group_count(Scope) ->
+    syn_groups:local_count(Scope).
+
+%% @doc Returns the group names for the `default' scope.
+%%
+%% The order of the group names is not guaranteed to be the same on all calls.
+%% Same as calling `group_names(default)', see {@link group_names/1}.
 %%
 %%
 %% <h2>Examples</h2>
 %% <h2>Examples</h2>
 %% <h3>Elixir</h3>
 %% <h3>Elixir</h3>
 %% ```
 %% ```
-%% iex> :syn.groups_count(:devices, :"two@example.com")
-%% 15422
+%% iex> :syn.group_names()
+%% ["area-1", "area-2"]
 %% '''
 %% '''
 %% <h3>Erlang</h3>
 %% <h3>Erlang</h3>
 %% ```
 %% ```
-%% 1> syn:groups_count(devices, 'two@example.com').
-%% 15422
+%% 1> syn:group_names().
+%% ["area-1", "area-2"]
 %% '''
 %% '''
--spec groups_count(Scope :: atom(), Node :: node()) -> non_neg_integer().
-groups_count(Scope, Node) ->
-    syn_groups:count(Scope, Node).
+-spec group_names() -> [GroupName :: term()].
+group_names() ->
+    syn_groups:group_names().
 
 
-%% @doc Returns the count of all the groups for the `default' scope which have at least 1 process running
-%% on Node.
+%% @doc Returns the group names for the specified `Scope'.
 %%
 %%
-%% Same as `groups_count(default, node())'.
--spec local_groups_count() -> non_neg_integer().
-local_groups_count() ->
-    syn_groups:local_count().
+%% The order of the group names is not guaranteed to be the same on all calls.
+-spec group_names(Scope :: atom()) -> [GroupName :: term()].
+group_names(Scope) ->
+    syn_groups:group_names(Scope).
 
 
-%% @doc Returns the count of all the groups for the specified Scope which have at least 1 process running
-%% on Node.
+%% @doc Returns the group names for the specified `Scope' which have at least 1 process running on `Node'.
 %%
 %%
-%% Same as `groups_count(Scope, node())'.
--spec local_groups_count(Scope :: atom()) -> non_neg_integer().
-local_groups_count(Scope) ->
-    syn_groups:local_count(Scope).
-
--spec groups_names() -> [GroupName :: term()].
-groups_names() ->
-    syn_groups:groups_names().
-
--spec groups_names(Scope :: atom()) -> [GroupName :: term()].
-groups_names(Scope) ->
-    syn_groups:groups_names(Scope).
+%% The order of the group names is not guaranteed to be the same on all calls.
+-spec group_names(Scope :: atom(), Node :: node()) -> [GroupName :: term()].
+group_names(Scope, Node) ->
+    syn_groups:group_names(Scope, Node).
 
 
--spec groups_names(Scope :: atom(), Node :: node()) -> [GroupName :: term()].
-groups_names(Scope, Node) ->
-    syn_groups:groups_names(Scope, Node).
-
--spec local_groups_names() -> [GroupName :: term()].
-local_groups_names() ->
-    syn_groups:local_groups_names().
+%% @doc Returns the group names which have at least 1 process running on `Node' for the `default' scope.
+%%
+%% Same as calling `group_names(default, node())', see {@link group_names/2}.
+-spec local_group_names() -> [GroupName :: term()].
+local_group_names() ->
+    syn_groups:local_group_names().
 
 
--spec local_groups_names(Scope :: atom()) -> [GroupName :: term()].
-local_groups_names(Scope) ->
-    syn_groups:local_groups_names(Scope).
+%% @doc Returns the group names which have at least 1 process running on `Node' for the specified `Scope'.
+%%
+%% Same as calling `group_names(Scope, node())', see {@link group_names/2}.
+-spec local_group_names(Scope :: atom()) -> [GroupName :: term()].
+local_group_names(Scope) ->
+    syn_groups:local_group_names(Scope).
 
 
+%% @doc Publish a message to all group members in the `default' scope.
+%%
+%% Same as calling `publish(default, GroupName, Message)', see {@link publish/3}.
+%%
+%% <h2>Examples</h2>
+%% <h3>Elixir</h3>
+%% ```
+%% iex> :syn.join("area-1", self())
+%% :ok
+%% iex> :syn.publish("area-1", :my_message)
+%% {:ok,1}
+%% iex> flush().
+%% Shell got :my_message
+%% :ok
+%% '''
+%% <h3>Erlang</h3>
+%% ```
+%% 1> syn:join("area-1", self()).
+%% ok
+%% 2> syn:publish("area-1", my_message).
+%% {ok,1}
+%% 3> flush().
+%% Shell got my_message
+%% ok
+%% '''
 -spec publish(GroupName :: any(), Message :: any()) -> {ok, RecipientCount :: non_neg_integer()}.
 -spec publish(GroupName :: any(), Message :: any()) -> {ok, RecipientCount :: non_neg_integer()}.
 publish(GroupName, Message) ->
 publish(GroupName, Message) ->
     syn_groups:publish(GroupName, Message).
     syn_groups:publish(GroupName, Message).
 
 
+%% @doc Publish a message to all group members in the Specified scope.
+%%
+%% `RecipientCount' is the count of the intended recipients.
+%%
+%% <h2>Examples</h2>
+%% <h3>Elixir</h3>
+%% ```
+%% iex> :syn.add_node_to_scope(:devices)
+%% :ok
+%% iex> :syn.join(:devices, "area-1", self())
+%% :ok
+%% iex> :syn.publish(:devices, "area-1", :my_message)
+%% {:ok,1}
+%% iex> flush().
+%% Shell got :my_message
+%% :ok
+%% '''
+%% <h3>Erlang</h3>
+%% ```
+%% 1> syn:add_node_to_scope(devices).
+%% ok
+%% 2> syn:join(devices, "area-1", self()).
+%% ok
+%% 3> syn:publish(devices, "area-1", my_message).
+%% {ok,1}
+%% 4> flush().
+%% Shell got my_message
+%% ok
+%% '''
 -spec publish(Scope :: atom(), GroupName :: any(), Message :: any()) -> {ok, RecipientCount :: non_neg_integer()}.
 -spec publish(Scope :: atom(), GroupName :: any(), Message :: any()) -> {ok, RecipientCount :: non_neg_integer()}.
 publish(Scope, GroupName, Message) ->
 publish(Scope, GroupName, Message) ->
     syn_groups:publish(Scope, GroupName, Message).
     syn_groups:publish(Scope, GroupName, Message).
 
 
+%% @doc Publish a message to all group members running on the local node in the `default' scope.
+%%
+%% Same as calling `local_publish(default, GroupName, Message)', see {@link local_publish/3}.
 -spec local_publish(GroupName :: any(), Message :: any()) -> {ok, RecipientCount :: non_neg_integer()}.
 -spec local_publish(GroupName :: any(), Message :: any()) -> {ok, RecipientCount :: non_neg_integer()}.
 local_publish(GroupName, Message) ->
 local_publish(GroupName, Message) ->
     syn_groups:local_publish(GroupName, Message).
     syn_groups:local_publish(GroupName, Message).
 
 
+%% @doc Publish a message to all group members running on the local node in the specified `Scope'.
+%%
+%% `RecipientCount' is the count of the intended recipients.
 -spec local_publish(Scope :: atom(), GroupName :: any(), Message :: any()) -> {ok, RecipientCount :: non_neg_integer()}.
 -spec local_publish(Scope :: atom(), GroupName :: any(), Message :: any()) -> {ok, RecipientCount :: non_neg_integer()}.
 local_publish(Scope, GroupName, Message) ->
 local_publish(Scope, GroupName, Message) ->
     syn_groups:local_publish(Scope, GroupName, Message).
     syn_groups:local_publish(Scope, GroupName, Message).
 
 
+%% @doc Calls all group members node in the `default' scope and collects their replies.
+%%
+%% Same as calling `multi_call(default, GroupName, Message, 5000)', see {@link multi_call/4}.
 -spec multi_call(GroupName :: any(), Message :: any()) ->
 -spec multi_call(GroupName :: any(), Message :: any()) ->
     {[{pid(), Reply :: any()}], [BadPid :: pid()]}.
     {[{pid(), Reply :: any()}], [BadPid :: pid()]}.
 multi_call(GroupName, Message) ->
 multi_call(GroupName, Message) ->
     syn_groups:multi_call(GroupName, Message).
     syn_groups:multi_call(GroupName, Message).
 
 
+%% @doc Calls all group members running in the specified `Scope' and collects their replies.
+%%
+%% Same as calling `multi_call(Scope, GroupName, Message, 5000)', see {@link multi_call/4}.
 -spec multi_call(Scope :: atom(), GroupName :: any(), Message :: any()) ->
 -spec multi_call(Scope :: atom(), GroupName :: any(), Message :: any()) ->
-    {[{pid(), Reply :: any()}], [BadPid :: pid()]}.
+    {
+        Replies :: [{{pid(), Meta :: term()}, Reply :: term()}],
+        BadReplies :: [{pid(), Meta :: term()}]
+    }.
 multi_call(Scope, GroupName, Message) ->
 multi_call(Scope, GroupName, Message) ->
     syn_groups:multi_call(Scope, GroupName, Message).
     syn_groups:multi_call(Scope, GroupName, Message).
 
 
+%% @doc Calls all group members running  in the specified `Scope' and collects their replies.
+%%
+%% When this call is issued, all members will receive a tuple in the format:
+%%
+%% `{syn_multi_call, CallerPid, Message}'
+%%
+%% To reply, every member MUST use the method {@link multi_call_reply/2}.
+%%
+%% Syn will wait up to the value specified in `Timeout' to receive all replies from the members.
+%% The responses will be added to the `Replies' list, while the members that do not reply in time or that crash
+%% before sending a reply will be added to the `BadReplies' list.
 -spec multi_call(Scope :: atom(), GroupName :: any(), Message :: any(), Timeout :: non_neg_integer()) ->
 -spec multi_call(Scope :: atom(), GroupName :: any(), Message :: any(), Timeout :: non_neg_integer()) ->
-    {[{pid(), Reply :: any()}], [BadPid :: pid()]}.
+    {
+        Replies :: [{{pid(), Meta :: term()}, Reply :: term()}],
+        BadReplies :: [{pid(), Meta :: term()}]
+    }.
 multi_call(Scope, GroupName, Message, Timeout) ->
 multi_call(Scope, GroupName, Message, Timeout) ->
     syn_groups:multi_call(Scope, GroupName, Message, Timeout).
     syn_groups:multi_call(Scope, GroupName, Message, Timeout).
 
 
+%% @doc Allows a group member to reply to a multi call.
+%%
+%% See {@link multi_call/4} for info.
 -spec multi_call_reply(CallerPid :: pid(), Reply :: any()) -> {syn_multi_call_reply, pid(), Reply :: any()}.
 -spec multi_call_reply(CallerPid :: pid(), Reply :: any()) -> {syn_multi_call_reply, pid(), Reply :: any()}.
 multi_call_reply(CallerPid, Reply) ->
 multi_call_reply(CallerPid, Reply) ->
     syn_groups:multi_call_reply(CallerPid, Reply).
     syn_groups:multi_call_reply(CallerPid, Reply).

+ 30 - 23
src/syn_groups.erl

@@ -37,8 +37,8 @@
 -export([is_local_member/2, is_local_member/3]).
 -export([is_local_member/2, is_local_member/3]).
 -export([count/0, count/1, count/2]).
 -export([count/0, count/1, count/2]).
 -export([local_count/0, local_count/1]).
 -export([local_count/0, local_count/1]).
--export([groups_names/0, groups_names/1, groups_names/2]).
--export([local_groups_names/0, local_groups_names/1]).
+-export([group_names/0, group_names/1, group_names/2]).
+-export([local_group_names/0, local_group_names/1]).
 -export([publish/2, publish/3]).
 -export([publish/2, publish/3]).
 -export([local_publish/2, local_publish/3]).
 -export([local_publish/2, local_publish/3]).
 -export([multi_call/2, multi_call/3, multi_call/4, multi_call_reply/2]).
 -export([multi_call/2, multi_call/3, multi_call/4, multi_call_reply/2]).
@@ -197,12 +197,12 @@ count() ->
 
 
 -spec count(Scope :: atom()) -> non_neg_integer().
 -spec count(Scope :: atom()) -> non_neg_integer().
 count(Scope) ->
 count(Scope) ->
-    Set = groups_names_ordset(Scope, '_'),
+    Set = group_names_ordset(Scope, '_'),
     ordsets:size(Set).
     ordsets:size(Set).
 
 
 -spec count(Scope :: atom(), Node :: node()) -> non_neg_integer().
 -spec count(Scope :: atom(), Node :: node()) -> non_neg_integer().
 count(Scope, Node) ->
 count(Scope, Node) ->
-    Set = groups_names_ordset(Scope, Node),
+    Set = group_names_ordset(Scope, Node),
     ordsets:size(Set).
     ordsets:size(Set).
 
 
 -spec local_count() -> non_neg_integer().
 -spec local_count() -> non_neg_integer().
@@ -213,30 +213,30 @@ local_count() ->
 local_count(Scope) ->
 local_count(Scope) ->
     count(Scope, node()).
     count(Scope, node()).
 
 
--spec groups_names() -> [GroupName :: term()].
-groups_names() ->
-    groups_names(?DEFAULT_SCOPE).
+-spec group_names() -> [GroupName :: term()].
+group_names() ->
+    group_names(?DEFAULT_SCOPE).
 
 
--spec groups_names(Scope :: atom()) -> [GroupName :: term()].
-groups_names(Scope) ->
-    Set = groups_names_ordset(Scope, '_'),
+-spec group_names(Scope :: atom()) -> [GroupName :: term()].
+group_names(Scope) ->
+    Set = group_names_ordset(Scope, '_'),
     ordsets:to_list(Set).
     ordsets:to_list(Set).
 
 
--spec groups_names(Scope :: atom(), Node :: node()) -> [GroupName :: term()].
-groups_names(Scope, Node) ->
-    Set = groups_names_ordset(Scope, Node),
+-spec group_names(Scope :: atom(), Node :: node()) -> [GroupName :: term()].
+group_names(Scope, Node) ->
+    Set = group_names_ordset(Scope, Node),
     ordsets:to_list(Set).
     ordsets:to_list(Set).
 
 
--spec local_groups_names() -> [GroupName :: term()].
-local_groups_names() ->
-    groups_names(?DEFAULT_SCOPE, node()).
+-spec local_group_names() -> [GroupName :: term()].
+local_group_names() ->
+    group_names(?DEFAULT_SCOPE, node()).
 
 
--spec local_groups_names(Scope :: atom()) -> [GroupName :: term()].
-local_groups_names(Scope) ->
-    groups_names(Scope, node()).
+-spec local_group_names(Scope :: atom()) -> [GroupName :: term()].
+local_group_names(Scope) ->
+    group_names(Scope, node()).
 
 
--spec groups_names_ordset(Scope :: atom(), Node :: node()) -> ordsets:ordset(GroupName :: term()).
-groups_names_ordset(Scope, NodeParam) ->
+-spec group_names_ordset(Scope :: atom(), Node :: node()) -> ordsets:ordset(GroupName :: term()).
+group_names_ordset(Scope, NodeParam) ->
     case syn_backbone:get_table_name(syn_groups_by_name, Scope) of
     case syn_backbone:get_table_name(syn_groups_by_name, Scope) of
         undefined ->
         undefined ->
             error({invalid_scope, Scope});
             error({invalid_scope, Scope});
@@ -280,12 +280,19 @@ do_publish(Members, Message) ->
 multi_call(GroupName, Message) ->
 multi_call(GroupName, Message) ->
     multi_call(?DEFAULT_SCOPE, GroupName, Message).
     multi_call(?DEFAULT_SCOPE, GroupName, Message).
 
 
--spec multi_call(Scope :: atom(), GroupName :: term(), Message :: term()) -> {[{pid(), Reply :: term()}], [BadPid :: pid()]}.
+-spec multi_call(Scope :: atom(), GroupName :: term(), Message :: term()) ->
+    {
+        Replies :: [{{pid(), Meta :: term()}, Reply :: term()}],
+        BadReplies :: [{pid(), Meta :: term()}]
+    }.
 multi_call(Scope, GroupName, Message) ->
 multi_call(Scope, GroupName, Message) ->
     multi_call(Scope, GroupName, Message, ?DEFAULT_MULTI_CALL_TIMEOUT_MS).
     multi_call(Scope, GroupName, Message, ?DEFAULT_MULTI_CALL_TIMEOUT_MS).
 
 
 -spec multi_call(Scope :: atom(), GroupName :: term(), Message :: term(), Timeout :: non_neg_integer()) ->
 -spec multi_call(Scope :: atom(), GroupName :: term(), Message :: term(), Timeout :: non_neg_integer()) ->
-    {[{pid(), Reply :: term()}], [BadPid :: pid()]}.
+    {
+        Replies :: [{{pid(), Meta :: term()}, Reply :: term()}],
+        BadReplies :: [{pid(), Meta :: term()}]
+    }.
 multi_call(Scope, GroupName, Message, Timeout) ->
 multi_call(Scope, GroupName, Message, Timeout) ->
     Self = self(),
     Self = self(),
     Members = members(Scope, GroupName),
     Members = members(Scope, GroupName),

+ 231 - 231
test/syn_groups_SUITE.erl

@@ -43,8 +43,8 @@
     three_nodes_publish_custom_scope/1,
     three_nodes_publish_custom_scope/1,
     three_nodes_multi_call_default_scope/1,
     three_nodes_multi_call_default_scope/1,
     three_nodes_multi_call_custom_scope/1,
     three_nodes_multi_call_custom_scope/1,
-    three_nodes_groups_names_default_scope/1,
-    three_nodes_groups_names_custom_scope/1
+    three_nodes_group_names_default_scope/1,
+    three_nodes_group_names_custom_scope/1
 ]).
 ]).
 
 
 %% internals
 %% internals
@@ -98,8 +98,8 @@ groups() ->
             three_nodes_publish_custom_scope,
             three_nodes_publish_custom_scope,
             three_nodes_multi_call_default_scope,
             three_nodes_multi_call_default_scope,
             three_nodes_multi_call_custom_scope,
             three_nodes_multi_call_custom_scope,
-            three_nodes_groups_names_default_scope,
-            three_nodes_groups_names_custom_scope
+            three_nodes_group_names_default_scope,
+            three_nodes_group_names_custom_scope
         ]}
         ]}
     ].
     ].
 %% -------------------------------------------------------------------
 %% -------------------------------------------------------------------
@@ -432,10 +432,10 @@ three_nodes_join_leave_and_monitor_default_scope(Config) ->
     false = rpc:call(SlaveNode2, syn, is_local_member, [{group, "two"}, PidWithMeta]),
     false = rpc:call(SlaveNode2, syn, is_local_member, [{group, "two"}, PidWithMeta]),
     false = rpc:call(SlaveNode2, syn, is_local_member, [{group, "two"}, PidRemoteOn1]),
     false = rpc:call(SlaveNode2, syn, is_local_member, [{group, "two"}, PidRemoteOn1]),
 
 
-    0 = syn:groups_count(),
-    0 = syn:groups_count(default, node()),
-    0 = syn:groups_count(default, SlaveNode1),
-    0 = syn:groups_count(default, SlaveNode2),
+    0 = syn:group_count(),
+    0 = syn:group_count(default, node()),
+    0 = syn:group_count(default, SlaveNode1),
+    0 = syn:group_count(default, SlaveNode2),
 
 
     %% join
     %% join
     ok = syn:join({group, "one"}, Pid),
     ok = syn:join({group, "one"}, Pid),
@@ -537,10 +537,10 @@ three_nodes_join_leave_and_monitor_default_scope(Config) ->
     false = rpc:call(SlaveNode2, syn, is_local_member, [{group, "two"}, PidWithMeta]),
     false = rpc:call(SlaveNode2, syn, is_local_member, [{group, "two"}, PidWithMeta]),
     false = rpc:call(SlaveNode2, syn, is_local_member, [{group, "two"}, PidRemoteOn1]),
     false = rpc:call(SlaveNode2, syn, is_local_member, [{group, "two"}, PidRemoteOn1]),
 
 
-    2 = syn:groups_count(),
-    2 = syn:groups_count(default, node()),
-    1 = syn:groups_count(default, SlaveNode1),
-    0 = syn:groups_count(default, SlaveNode2),
+    2 = syn:group_count(),
+    2 = syn:group_count(default, node()),
+    1 = syn:group_count(default, SlaveNode1),
+    0 = syn:group_count(default, SlaveNode2),
 
 
     %% re-join to edit meta
     %% re-join to edit meta
     ok = syn:join({group, "one"}, PidWithMeta, <<"with updated meta">>),
     ok = syn:join({group, "one"}, PidWithMeta, <<"with updated meta">>),
@@ -599,10 +599,10 @@ three_nodes_join_leave_and_monitor_default_scope(Config) ->
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [{group, "two"}])) end
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [{group, "two"}])) end
     ),
     ),
 
 
-    2 = syn:groups_count(),
-    2 = syn:groups_count(default, node()),
-    1 = syn:groups_count(default, SlaveNode1),
-    0 = syn:groups_count(default, SlaveNode2),
+    2 = syn:group_count(),
+    2 = syn:group_count(default, node()),
+    1 = syn:group_count(default, SlaveNode1),
+    0 = syn:group_count(default, SlaveNode2),
 
 
     %% crash scope process to ensure that monitors get recreated
     %% crash scope process to ensure that monitors get recreated
     exit(whereis(syn_groups_default), kill),
     exit(whereis(syn_groups_default), kill),
@@ -703,10 +703,10 @@ three_nodes_join_leave_and_monitor_default_scope(Config) ->
     false = rpc:call(SlaveNode2, syn, is_local_member, [{group, "two"}, PidWithMeta]),
     false = rpc:call(SlaveNode2, syn, is_local_member, [{group, "two"}, PidWithMeta]),
     false = rpc:call(SlaveNode2, syn, is_local_member, [{group, "two"}, PidRemoteOn1]),
     false = rpc:call(SlaveNode2, syn, is_local_member, [{group, "two"}, PidRemoteOn1]),
 
 
-    1 = syn:groups_count(),
-    1 = syn:groups_count(default, node()),
-    0 = syn:groups_count(default, SlaveNode1),
-    0 = syn:groups_count(default, SlaveNode2),
+    1 = syn:group_count(),
+    1 = syn:group_count(default, node()),
+    0 = syn:group_count(default, SlaveNode1),
+    0 = syn:group_count(default, SlaveNode2),
 
 
     %% errors
     %% errors
     {error, not_in_group} = syn:leave({group, "one"}, PidWithMeta).
     {error, not_in_group} = syn:leave({group, "one"}, PidWithMeta).
@@ -894,30 +894,30 @@ three_nodes_join_leave_and_monitor_custom_scope(Config) ->
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [custom_scope_bc, {group, "two"}])) end
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [custom_scope_bc, {group, "two"}])) end
     ),
     ),
 
 
-    2 = syn:groups_count(custom_scope_ab),
-    2 = syn:groups_count(custom_scope_ab, node()),
-    0 = syn:groups_count(custom_scope_ab, SlaveNode1),
-    0 = syn:groups_count(custom_scope_ab, SlaveNode2),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, node()),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, SlaveNode1),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, SlaveNode2),
-    2 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_ab]),
-    2 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_ab, node()]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_ab, SlaveNode1]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_ab, SlaveNode2]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, node()]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, SlaveNode1]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, SlaveNode2]),
-    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, groups_count, [custom_scope_ab]),
-    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, groups_count, [custom_scope_ab, node()]),
-    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, groups_count, [custom_scope_ab, SlaveNode1]),
-    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, groups_count, [custom_scope_ab, SlaveNode2]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, node()]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, SlaveNode1]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, SlaveNode2]),
+    2 = syn:group_count(custom_scope_ab),
+    2 = syn:group_count(custom_scope_ab, node()),
+    0 = syn:group_count(custom_scope_ab, SlaveNode1),
+    0 = syn:group_count(custom_scope_ab, SlaveNode2),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, node()),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, SlaveNode1),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, SlaveNode2),
+    2 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_ab]),
+    2 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_ab, node()]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_ab, SlaveNode1]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_ab, SlaveNode2]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, node()]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, SlaveNode1]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, SlaveNode2]),
+    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, group_count, [custom_scope_ab]),
+    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, group_count, [custom_scope_ab, node()]),
+    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, group_count, [custom_scope_ab, SlaveNode1]),
+    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, group_count, [custom_scope_ab, SlaveNode2]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, node()]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, SlaveNode1]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, SlaveNode2]),
 
 
     %% re-join to edit meta
     %% re-join to edit meta
     ok = syn:join(custom_scope_ab, {group, "one"}, PidWithMeta, <<"with updated meta">>),
     ok = syn:join(custom_scope_ab, {group, "one"}, PidWithMeta, <<"with updated meta">>),
@@ -984,30 +984,30 @@ three_nodes_join_leave_and_monitor_custom_scope(Config) ->
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [custom_scope_bc, {group, "two"}])) end
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [custom_scope_bc, {group, "two"}])) end
     ),
     ),
 
 
-    2 = syn:groups_count(custom_scope_ab),
-    2 = syn:groups_count(custom_scope_ab, node()),
-    0 = syn:groups_count(custom_scope_ab, SlaveNode1),
-    0 = syn:groups_count(custom_scope_ab, SlaveNode2),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, node()),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, SlaveNode1),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, SlaveNode2),
-    2 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_ab]),
-    2 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_ab, node()]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_ab, SlaveNode1]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_ab, SlaveNode2]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, node()]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, SlaveNode1]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, SlaveNode2]),
-    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, groups_count, [custom_scope_ab]),
-    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, groups_count, [custom_scope_ab, node()]),
-    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, groups_count, [custom_scope_ab, SlaveNode1]),
-    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, groups_count, [custom_scope_ab, SlaveNode2]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, node()]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, SlaveNode1]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, SlaveNode2]),
+    2 = syn:group_count(custom_scope_ab),
+    2 = syn:group_count(custom_scope_ab, node()),
+    0 = syn:group_count(custom_scope_ab, SlaveNode1),
+    0 = syn:group_count(custom_scope_ab, SlaveNode2),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, node()),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, SlaveNode1),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, SlaveNode2),
+    2 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_ab]),
+    2 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_ab, node()]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_ab, SlaveNode1]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_ab, SlaveNode2]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, node()]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, SlaveNode1]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, SlaveNode2]),
+    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, group_count, [custom_scope_ab]),
+    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, group_count, [custom_scope_ab, node()]),
+    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, group_count, [custom_scope_ab, SlaveNode1]),
+    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, group_count, [custom_scope_ab, SlaveNode2]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, node()]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, SlaveNode1]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, SlaveNode2]),
 
 
     %% crash scope process to ensure that monitors get recreated
     %% crash scope process to ensure that monitors get recreated
     exit(whereis(syn_groups_custom_scope_ab), kill),
     exit(whereis(syn_groups_custom_scope_ab), kill),
@@ -1106,30 +1106,30 @@ three_nodes_join_leave_and_monitor_custom_scope(Config) ->
         [], fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [custom_scope_bc, {group, "two"}])) end
         [], fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [custom_scope_bc, {group, "two"}])) end
     ),
     ),
 
 
-    1 = syn:groups_count(custom_scope_ab),
-    1 = syn:groups_count(custom_scope_ab, node()),
-    0 = syn:groups_count(custom_scope_ab, SlaveNode1),
-    0 = syn:groups_count(custom_scope_ab, SlaveNode2),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, node()),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, SlaveNode1),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, SlaveNode2),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_ab]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_ab, node()]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_ab, SlaveNode1]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_ab, SlaveNode2]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, node()]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, SlaveNode1]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, SlaveNode2]),
-    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, groups_count, [custom_scope_ab]),
-    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, groups_count, [custom_scope_ab, node()]),
-    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, groups_count, [custom_scope_ab, SlaveNode1]),
-    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, groups_count, [custom_scope_ab, SlaveNode2]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, node()]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, SlaveNode1]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, SlaveNode2]),
+    1 = syn:group_count(custom_scope_ab),
+    1 = syn:group_count(custom_scope_ab, node()),
+    0 = syn:group_count(custom_scope_ab, SlaveNode1),
+    0 = syn:group_count(custom_scope_ab, SlaveNode2),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, node()),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, SlaveNode1),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, SlaveNode2),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_ab]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_ab, node()]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_ab, SlaveNode1]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_ab, SlaveNode2]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, node()]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, SlaveNode1]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, SlaveNode2]),
+    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, group_count, [custom_scope_ab]),
+    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, group_count, [custom_scope_ab, node()]),
+    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, group_count, [custom_scope_ab, SlaveNode1]),
+    {badrpc, {'EXIT', {{invalid_scope, custom_scope_ab}, _}}} = catch rpc:call(SlaveNode2, syn, group_count, [custom_scope_ab, SlaveNode2]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, node()]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, SlaveNode1]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, SlaveNode2]),
 
 
     %% errors
     %% errors
     {error, not_in_group} = syn:leave(custom_scope_ab, {group, "one"}, PidWithMeta).
     {error, not_in_group} = syn:leave(custom_scope_ab, {group, "one"}, PidWithMeta).
@@ -1225,18 +1225,18 @@ three_nodes_cluster_changes(Config) ->
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [<<"group-2">>])) end
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [<<"group-2">>])) end
     ),
     ),
 
 
-    2 = syn:groups_count(),
-    0 = syn:groups_count(default, node()),
-    1 = syn:groups_count(default, SlaveNode1),
-    2 = syn:groups_count(default, SlaveNode2),
-    2 = rpc:call(SlaveNode1, syn, groups_count, []),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [default, node()]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [default, SlaveNode1]),
-    2 = rpc:call(SlaveNode1, syn, groups_count, [default, SlaveNode2]),
-    2 = rpc:call(SlaveNode2, syn, groups_count, []),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [default, node()]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [default, SlaveNode1]),
-    2 = rpc:call(SlaveNode2, syn, groups_count, [default, SlaveNode2]),
+    2 = syn:group_count(),
+    0 = syn:group_count(default, node()),
+    1 = syn:group_count(default, SlaveNode1),
+    2 = syn:group_count(default, SlaveNode2),
+    2 = rpc:call(SlaveNode1, syn, group_count, []),
+    0 = rpc:call(SlaveNode1, syn, group_count, [default, node()]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [default, SlaveNode1]),
+    2 = rpc:call(SlaveNode1, syn, group_count, [default, SlaveNode2]),
+    2 = rpc:call(SlaveNode2, syn, group_count, []),
+    0 = rpc:call(SlaveNode2, syn, group_count, [default, node()]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [default, SlaveNode1]),
+    2 = rpc:call(SlaveNode2, syn, group_count, [default, SlaveNode2]),
 
 
     {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:members(custom_scope_bc, <<"scoped-on-bc">>),
     {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:members(custom_scope_bc, <<"scoped-on-bc">>),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
@@ -1258,18 +1258,18 @@ three_nodes_cluster_changes(Config) ->
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [custom_scope_bc, <<"scoped-on-bc">>])) end
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [custom_scope_bc, <<"scoped-on-bc">>])) end
     ),
     ),
 
 
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, node()),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, SlaveNode1),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, SlaveNode2),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, node()]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, SlaveNode1]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, SlaveNode2]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, node()]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, SlaveNode1]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, SlaveNode2]),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, node()),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, SlaveNode1),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, SlaveNode2),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, node()]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, SlaveNode1]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, SlaveNode2]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, node()]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, SlaveNode1]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, SlaveNode2]),
 
 
     %% partial netsplit (1 cannot see 2)
     %% partial netsplit (1 cannot see 2)
     rpc:call(SlaveNode1, syn_test_suite_helper, disconnect_node, [SlaveNode2]),
     rpc:call(SlaveNode1, syn_test_suite_helper, disconnect_node, [SlaveNode2]),
@@ -1330,18 +1330,18 @@ three_nodes_cluster_changes(Config) ->
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [<<"group-2">>])) end
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [<<"group-2">>])) end
     ),
     ),
 
 
-    2 = syn:groups_count(),
-    0 = syn:groups_count(default, node()),
-    1 = syn:groups_count(default, SlaveNode1),
-    2 = syn:groups_count(default, SlaveNode2),
-    1 = rpc:call(SlaveNode1, syn, groups_count, []),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [default, node()]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [default, SlaveNode1]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [default, SlaveNode2]),
-    2 = rpc:call(SlaveNode2, syn, groups_count, []),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [default, node()]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [default, SlaveNode1]),
-    2 = rpc:call(SlaveNode2, syn, groups_count, [default, SlaveNode2]),
+    2 = syn:group_count(),
+    0 = syn:group_count(default, node()),
+    1 = syn:group_count(default, SlaveNode1),
+    2 = syn:group_count(default, SlaveNode2),
+    1 = rpc:call(SlaveNode1, syn, group_count, []),
+    0 = rpc:call(SlaveNode1, syn, group_count, [default, node()]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [default, SlaveNode1]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [default, SlaveNode2]),
+    2 = rpc:call(SlaveNode2, syn, group_count, []),
+    0 = rpc:call(SlaveNode2, syn, group_count, [default, node()]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [default, SlaveNode1]),
+    2 = rpc:call(SlaveNode2, syn, group_count, [default, SlaveNode2]),
 
 
     {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:members(custom_scope_bc, <<"scoped-on-bc">>),
     {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:members(custom_scope_bc, <<"scoped-on-bc">>),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
@@ -1363,18 +1363,18 @@ three_nodes_cluster_changes(Config) ->
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [custom_scope_bc, <<"scoped-on-bc">>])) end
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [custom_scope_bc, <<"scoped-on-bc">>])) end
     ),
     ),
 
 
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, node()),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, SlaveNode1),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, SlaveNode2),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, node()]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, SlaveNode1]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, SlaveNode2]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, node()]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, SlaveNode1]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, SlaveNode2]),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, node()),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, SlaveNode1),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, SlaveNode2),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, node()]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, SlaveNode1]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, SlaveNode2]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, node()]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, SlaveNode1]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, SlaveNode2]),
 
 
     %% re-join
     %% re-join
     rpc:call(SlaveNode1, syn_test_suite_helper, connect_node, [SlaveNode2]),
     rpc:call(SlaveNode1, syn_test_suite_helper, connect_node, [SlaveNode2]),
@@ -1435,18 +1435,18 @@ three_nodes_cluster_changes(Config) ->
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [<<"group-2">>])) end
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [<<"group-2">>])) end
     ),
     ),
 
 
-    2 = syn:groups_count(),
-    0 = syn:groups_count(default, node()),
-    1 = syn:groups_count(default, SlaveNode1),
-    2 = syn:groups_count(default, SlaveNode2),
-    2 = rpc:call(SlaveNode1, syn, groups_count, []),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [default, node()]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [default, SlaveNode1]),
-    2 = rpc:call(SlaveNode1, syn, groups_count, [default, SlaveNode2]),
-    2 = rpc:call(SlaveNode2, syn, groups_count, []),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [default, node()]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [default, SlaveNode1]),
-    2 = rpc:call(SlaveNode2, syn, groups_count, [default, SlaveNode2]),
+    2 = syn:group_count(),
+    0 = syn:group_count(default, node()),
+    1 = syn:group_count(default, SlaveNode1),
+    2 = syn:group_count(default, SlaveNode2),
+    2 = rpc:call(SlaveNode1, syn, group_count, []),
+    0 = rpc:call(SlaveNode1, syn, group_count, [default, node()]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [default, SlaveNode1]),
+    2 = rpc:call(SlaveNode1, syn, group_count, [default, SlaveNode2]),
+    2 = rpc:call(SlaveNode2, syn, group_count, []),
+    0 = rpc:call(SlaveNode2, syn, group_count, [default, node()]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [default, SlaveNode1]),
+    2 = rpc:call(SlaveNode2, syn, group_count, [default, SlaveNode2]),
 
 
     {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:members(custom_scope_bc, <<"scoped-on-bc">>),
     {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:members(custom_scope_bc, <<"scoped-on-bc">>),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
@@ -1468,18 +1468,18 @@ three_nodes_cluster_changes(Config) ->
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [custom_scope_bc, <<"scoped-on-bc">>])) end
         fun() -> lists:sort(rpc:call(SlaveNode2, syn, local_members, [custom_scope_bc, <<"scoped-on-bc">>])) end
     ),
     ),
 
 
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, node()),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, SlaveNode1),
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_count(custom_scope_bc, SlaveNode2),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc]),
-    0 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, node()]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, SlaveNode1]),
-    1 = rpc:call(SlaveNode1, syn, groups_count, [custom_scope_bc, SlaveNode2]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc]),
-    0 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, node()]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, SlaveNode1]),
-    1 = rpc:call(SlaveNode2, syn, groups_count, [custom_scope_bc, SlaveNode2]).
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, node()),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, SlaveNode1),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_count(custom_scope_bc, SlaveNode2),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc]),
+    0 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, node()]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, SlaveNode1]),
+    1 = rpc:call(SlaveNode1, syn, group_count, [custom_scope_bc, SlaveNode2]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc]),
+    0 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, node()]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, SlaveNode1]),
+    1 = rpc:call(SlaveNode2, syn, group_count, [custom_scope_bc, SlaveNode2]).
 
 
 three_nodes_custom_event_handler_joined_left(Config) ->
 three_nodes_custom_event_handler_joined_left(Config) ->
     %% get slaves
     %% get slaves
@@ -1843,7 +1843,7 @@ three_nodes_multi_call_custom_scope(Config) ->
     ]),
     ]),
     BadRepliesBC = [].
     BadRepliesBC = [].
 
 
-three_nodes_groups_names_default_scope(Config) ->
+three_nodes_group_names_default_scope(Config) ->
     %% get slaves
     %% get slaves
     SlaveNode1 = proplists:get_value(slave_node_1, Config),
     SlaveNode1 = proplists:get_value(slave_node_1, Config),
     SlaveNode2 = proplists:get_value(slave_node_2, Config),
     SlaveNode2 = proplists:get_value(slave_node_2, Config),
@@ -1870,53 +1870,53 @@ three_nodes_groups_names_default_scope(Config) ->
     %% retrieve
     %% retrieve
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-2">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-2">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(syn:groups_names()) end
+        fun() -> lists:sort(syn:group_names()) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
-        fun() -> lists:sort(syn:groups_names(default, node())) end
+        fun() -> lists:sort(syn:group_names(default, node())) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers-2">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers-2">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(syn:groups_names(default, SlaveNode1)) end
+        fun() -> lists:sort(syn:group_names(default, SlaveNode1)) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-2">>],
         [<<"subscribers-2">>],
-        fun() -> lists:sort(syn:groups_names(default, SlaveNode2)) end
+        fun() -> lists:sort(syn:group_names(default, SlaveNode2)) end
     ),
     ),
 
 
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-2">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-2">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [default, node()])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [default, node()])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers-2">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers-2">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [default, SlaveNode1])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [default, SlaveNode1])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-2">>],
         [<<"subscribers-2">>],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [default, SlaveNode2])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [default, SlaveNode2])) end
     ),
     ),
 
 
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-2">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-2">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [default, node()])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [default, node()])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers-2">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers-2">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [default, SlaveNode1])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [default, SlaveNode1])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-2">>],
         [<<"subscribers-2">>],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [default, SlaveNode2])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [default, SlaveNode2])) end
     ),
     ),
 
 
     %% leave
     %% leave
@@ -1927,53 +1927,53 @@ three_nodes_groups_names_default_scope(Config) ->
     %% retrieve
     %% retrieve
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(syn:groups_names()) end
+        fun() -> lists:sort(syn:group_names()) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(syn:groups_names(default, node())) end
+        fun() -> lists:sort(syn:group_names(default, node())) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-3">>],
         [<<"subscribers-3">>],
-        fun() -> lists:sort(syn:groups_names(default, SlaveNode1)) end
+        fun() -> lists:sort(syn:group_names(default, SlaveNode1)) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(syn:groups_names(default, SlaveNode2)) end
+        fun() -> lists:sort(syn:group_names(default, SlaveNode2)) end
     ),
     ),
 
 
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [default, node()])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [default, node()])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-3">>],
         [<<"subscribers-3">>],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [default, SlaveNode1])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [default, SlaveNode1])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [default, SlaveNode2])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [default, SlaveNode2])) end
     ),
     ),
 
 
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [default, node()])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [default, node()])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-3">>],
         [<<"subscribers-3">>],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [default, SlaveNode1])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [default, SlaveNode1])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [default, SlaveNode2])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [default, SlaveNode2])) end
     ),
     ),
 
 
     %% partial netsplit (1 cannot see 2)
     %% partial netsplit (1 cannot see 2)
@@ -1985,53 +1985,53 @@ three_nodes_groups_names_default_scope(Config) ->
     %% retrieve
     %% retrieve
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(syn:groups_names()) end
+        fun() -> lists:sort(syn:group_names()) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(syn:groups_names(default, node())) end
+        fun() -> lists:sort(syn:group_names(default, node())) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-3">>],
         [<<"subscribers-3">>],
-        fun() -> lists:sort(syn:groups_names(default, SlaveNode1)) end
+        fun() -> lists:sort(syn:group_names(default, SlaveNode1)) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(syn:groups_names(default, SlaveNode2)) end
+        fun() -> lists:sort(syn:group_names(default, SlaveNode2)) end
     ),
     ),
 
 
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [default, node()])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [default, node()])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-3">>],
         [<<"subscribers-3">>],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [default, SlaveNode1])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [default, SlaveNode1])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [default, SlaveNode2])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [default, SlaveNode2])) end
     ),
     ),
 
 
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [default, node()])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [default, node()])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [default, SlaveNode1])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [default, SlaveNode1])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [default, SlaveNode2])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [default, SlaveNode2])) end
     ),
     ),
 
 
     %% re-join
     %% re-join
@@ -2043,56 +2043,56 @@ three_nodes_groups_names_default_scope(Config) ->
     %% retrieve
     %% retrieve
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(syn:groups_names()) end
+        fun() -> lists:sort(syn:group_names()) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(syn:groups_names(default, node())) end
+        fun() -> lists:sort(syn:group_names(default, node())) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-3">>],
         [<<"subscribers-3">>],
-        fun() -> lists:sort(syn:groups_names(default, SlaveNode1)) end
+        fun() -> lists:sort(syn:group_names(default, SlaveNode1)) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(syn:groups_names(default, SlaveNode2)) end
+        fun() -> lists:sort(syn:group_names(default, SlaveNode2)) end
     ),
     ),
 
 
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [default, node()])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [default, node()])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-3">>],
         [<<"subscribers-3">>],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [default, SlaveNode1])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [default, SlaveNode1])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [default, SlaveNode2])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [default, SlaveNode2])) end
     ),
     ),
 
 
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-3">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [default, node()])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [default, node()])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-3">>],
         [<<"subscribers-3">>],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [default, SlaveNode1])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [default, SlaveNode1])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [default, SlaveNode2])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [default, SlaveNode2])) end
     ).
     ).
 
 
-three_nodes_groups_names_custom_scope(Config) ->
+three_nodes_group_names_custom_scope(Config) ->
     %% get slaves
     %% get slaves
     SlaveNode1 = proplists:get_value(slave_node_1, Config),
     SlaveNode1 = proplists:get_value(slave_node_1, Config),
     SlaveNode2 = proplists:get_value(slave_node_2, Config),
     SlaveNode2 = proplists:get_value(slave_node_2, Config),
@@ -2122,75 +2122,75 @@ three_nodes_groups_names_custom_scope(Config) ->
     ok = rpc:call(SlaveNode2, syn, join, [custom_scope_bc, <<"subscribers-2">>, PidRemoteOn2]),
     ok = rpc:call(SlaveNode2, syn, join, [custom_scope_bc, <<"subscribers-2">>, PidRemoteOn2]),
 
 
     %% errors
     %% errors
-    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:groups_names(custom_scope_bc),
+    {'EXIT', {{invalid_scope, custom_scope_bc}, _}} = catch syn:group_names(custom_scope_bc),
 
 
     %% retrieve
     %% retrieve
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
-        fun() -> lists:sort(syn:groups_names(custom_scope_ab)) end
+        fun() -> lists:sort(syn:group_names(custom_scope_ab)) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
-        fun() -> lists:sort(syn:groups_names(custom_scope_ab, node())) end
+        fun() -> lists:sort(syn:group_names(custom_scope_ab, node())) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(syn:groups_names(custom_scope_ab, SlaveNode1)) end
+        fun() -> lists:sort(syn:group_names(custom_scope_ab, SlaveNode1)) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(syn:groups_names(custom_scope_ab, SlaveNode2)) end
+        fun() -> lists:sort(syn:group_names(custom_scope_ab, SlaveNode2)) end
     ),
     ),
 
 
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [custom_scope_ab])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [custom_scope_ab])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [custom_scope_ab, node()])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [custom_scope_ab, node()])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [custom_scope_ab, SlaveNode1])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [custom_scope_ab, SlaveNode1])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [custom_scope_ab, SlaveNode2])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [custom_scope_ab, SlaveNode2])) end
     ),
     ),
 
 
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [custom_scope_bc])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [custom_scope_bc])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [custom_scope_bc, node()])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [custom_scope_bc, node()])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [custom_scope_bc, SlaveNode1])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [custom_scope_bc, SlaveNode1])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-2">>],
         [<<"subscribers-2">>],
-        fun() -> lists:sort(rpc:call(SlaveNode1, syn, groups_names, [custom_scope_bc, SlaveNode2])) end
+        fun() -> lists:sort(rpc:call(SlaveNode1, syn, group_names, [custom_scope_bc, SlaveNode2])) end
     ),
     ),
 
 
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
         lists:sort([<<"subscribers">>, <<"subscribers-2">>]),
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [custom_scope_bc])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [custom_scope_bc])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [],
         [],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [custom_scope_bc, node()])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [custom_scope_bc, node()])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers">>],
         [<<"subscribers">>],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [custom_scope_bc, SlaveNode1])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [custom_scope_bc, SlaveNode1])) end
     ),
     ),
     syn_test_suite_helper:assert_wait(
     syn_test_suite_helper:assert_wait(
         [<<"subscribers-2">>],
         [<<"subscribers-2">>],
-        fun() -> lists:sort(rpc:call(SlaveNode2, syn, groups_names, [custom_scope_bc, SlaveNode2])) end
+        fun() -> lists:sort(rpc:call(SlaveNode2, syn, group_names, [custom_scope_bc, SlaveNode2])) end
     ).
     ).
 
 
 %% ===================================================================
 %% ===================================================================