Module cpg_data

CPG Groups Handling.

Method of using cpg instead of pg2.

Copyright © 2011-2015 Michael Truog

Version: 1.5.1 Sep 9 2016 14:52:11 ------------------------------------------------------------------------

Authors: Michael Truog (mjtruog [at] gmail (dot) com).

Description

CPG Groups Handling.

Method of using cpg instead of pg2. The resulting process group handling is more scalable and more efficient. The groups state is obtained from the cpg process for a specific scope and is then used with the functions provided here, so that contention for the cpg process can be avoided.

Data Types

get_members_return()

get_members_return() = {ok, cpg:name(), [pid()]} | {error, {no_such_group, cpg:name()}}

get_pid_error_reason()

get_pid_error_reason() = {no_process, cpg:name()} | {no_such_group, cpg:name()}

state()

state() = {DictI::module(), GroupsData::any()}

Function Index

get_closest_pid/2

Get a group member, with local pids given priority.

.
get_closest_pid/3

Get a group member, with local pids given priority while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_empty_groups/0

Get empty group storage.

.
get_furthest_pid/2

Get a group member, with remote pids given priority.

.
get_furthest_pid/3

Get a group member, with remote pids given priority while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_groups/0

Get the group storage.

This provides the internal representation of process groups so that requests will not be blocked by the single process managing the scope of the process groups.
get_groups/1

Get the group storage for a particular scope or after a period of time.

This provides the internal representation of process groups so that requests will not be blocked by the single process managing the scope of the process groups.
get_groups/2

Get the group storage for a particular scope after a period of time.

This provides the internal representation of process groups so that requests will not be blocked by the single process managing the scope of the process groups.
get_groups/3

Get the group storage for a particular scope and destination after a period of time.

This provides the internal representation of process groups so that requests will not be blocked by the single process managing the scope of the process groups.
get_local_members/2

Get only the local members of a specific group.

.
get_local_members/3

Get only the local members of a specific group while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_local_newest_pid/2

Get the newest local group member.

.
get_local_newest_pid/3

Get the newest local group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_local_oldest_pid/2

Get the oldest local group member.

.
get_local_oldest_pid/3

Get the oldest local group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_local_pid/2

Get a local group member.

.
get_local_pid/3

Get a local group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_members/2

Get the members of a specific group.

.
get_members/3

Get the members of a specific group while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_newest_pid/2

Get the newest group member.

.
get_newest_pid/3

Get the newest group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_oldest_pid/2

Get the oldest group member.

.
get_oldest_pid/3

Get the oldest group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_random_pid/2

Get a group member.

.
get_random_pid/3

Get a group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_remote_members/2

Get only the remote members of a specific group.

.
get_remote_members/3

Get only the remote members of a specific group while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_remote_newest_pid/2

Get the newest remote group member.

.
get_remote_newest_pid/3

Get the newest remote group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_remote_oldest_pid/2

Get the oldest remote group member.

.
get_remote_oldest_pid/3

Get the oldest remote group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.
get_remote_pid/2

Get a remote group member.

.
get_remote_pid/3

Get a remote group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.
which_groups/1

Get all the groups currently defined.

.

Function Details

get_closest_pid/2

get_closest_pid(GroupName::cpg:name(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get a group member, with local pids given priority.

get_closest_pid/3

get_closest_pid(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get a group member, with local pids given priority while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_empty_groups/0

get_empty_groups() -> state()

Get empty group storage.

get_furthest_pid/2

get_furthest_pid(GroupName::cpg:name(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get a group member, with remote pids given priority.

get_furthest_pid/3

get_furthest_pid(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get a group member, with remote pids given priority while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_groups/0

get_groups() -> state()

Get the group storage.

This provides the internal representation of process groups so that requests will not be blocked by the single process managing the scope of the process groups.

get_groups/1

get_groups(Scope::atom() | non_neg_integer()) -> state() | reference()

Get the group storage for a particular scope or after a period of time.

This provides the internal representation of process groups so that requests will not be blocked by the single process managing the scope of the process groups.

get_groups/2

get_groups(Scope::atom(), Time::non_neg_integer()) -> reference()

Get the group storage for a particular scope after a period of time.

This provides the internal representation of process groups so that requests will not be blocked by the single process managing the scope of the process groups.

get_groups/3

get_groups(Scope::atom(), Destination::pid() | atom(), Time::non_neg_integer()) -> reference()

Get the group storage for a particular scope and destination after a period of time.

This provides the internal representation of process groups so that requests will not be blocked by the single process managing the scope of the process groups.

get_local_members/2

get_local_members(GroupName::cpg:name(), Groups::state()) -> get_members_return()

Get only the local members of a specific group.

get_local_members/3

get_local_members(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> get_members_return()

Get only the local members of a specific group while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_local_newest_pid/2

get_local_newest_pid(GroupName::cpg:name(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get the newest local group member.

get_local_newest_pid/3

get_local_newest_pid(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get the newest local group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_local_oldest_pid/2

get_local_oldest_pid(GroupName::cpg:name(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get the oldest local group member.

get_local_oldest_pid/3

get_local_oldest_pid(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get the oldest local group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_local_pid/2

get_local_pid(GroupName::cpg:name(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get a local group member.

get_local_pid/3

get_local_pid(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get a local group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_members/2

get_members(GroupName::cpg:name(), Groups::state()) -> get_members_return()

Get the members of a specific group.

get_members/3

get_members(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> get_members_return()

Get the members of a specific group while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_newest_pid/2

get_newest_pid(GroupName::cpg:name(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get the newest group member.

get_newest_pid/3

get_newest_pid(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get the newest group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_oldest_pid/2

get_oldest_pid(GroupName::cpg:name(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get the oldest group member.

get_oldest_pid/3

get_oldest_pid(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get the oldest group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_random_pid/2

get_random_pid(GroupName::cpg:name(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get a group member.

get_random_pid/3

get_random_pid(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get a group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_remote_members/2

get_remote_members(GroupName::cpg:name(), Groups::state()) -> get_members_return()

Get only the remote members of a specific group.

get_remote_members/3

get_remote_members(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> get_members_return()

Get only the remote members of a specific group while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_remote_newest_pid/2

get_remote_newest_pid(GroupName::cpg:name(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get the newest remote group member.

get_remote_newest_pid/3

get_remote_newest_pid(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get the newest remote group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_remote_oldest_pid/2

get_remote_oldest_pid(GroupName::cpg:name(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get the oldest remote group member.

get_remote_oldest_pid/3

get_remote_oldest_pid(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get the oldest remote group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.

get_remote_pid/2

get_remote_pid(GroupName::cpg:name(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get a remote group member.

get_remote_pid/3

get_remote_pid(GroupName::cpg:name(), Exclude::pid(), Groups::state()) -> {ok, cpg:name(), pid()} | {error, get_pid_error_reason()}

Get a remote group member while excluding a specific pid.

Usually the self() pid is excluded with this function call.

which_groups/1

which_groups(X1::state()) -> [cpg:name()]

Get all the groups currently defined.


Generated by EDoc, Sep 9 2016, 14:52:12.