-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtopological.erl
41 lines (35 loc) · 1.1 KB
/
topological.erl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
%% @doc
%% Class of data structures that maintain a topological relation between actors
-module(topological).
-export([behaviour_info/1]).
behaviour_info(callbacks) ->
[
%%
%% Join an actor to topology and returns a new topology.
%%
%% -spec join(key(), datum:topological(_)) -> datum:topological().
{join, 2},
%%
%% Leave an actor from topology, and returns a new topology.
%% Note, semantic of leave operation do not assume leave due to transitive failures.
%%
%% -spec leave(key(), datum:topological(_)) -> datum:topological().
{leave, 2},
%%
%% Check is an actor exists in topology
%%
%% -spec has(key(), datum:topological(_)) -> true | false.
{has, 2},
%%
%% Looks up an topology and returns location of any arbitrary key
%%
%% -spec whereis(key(), datum:topological(_)) -> {address(), key()}.
{whereis, 2},
%%
%% Return list of topology members
%%
%% -spec members(datum:topological(_)) -> [key()].
{members, 1}
];
behaviour_info(_Other) ->
undefined.