Module elector_strategy_behaviour

Defines the base behaviour for election strategies.

Description

Defines the base behaviour for election strategies.

Data Types

candidate_nodes()

candidate_nodes() = [node()]

leader()

leader() = node()

Function Index

candidate_nodes/0Returns a list of nodes that are eligible to become the leader.
elect/0Starts the election process by triggering the strategy modules elect() function.

Function Details

candidate_nodes/0

candidate_nodes() -> CandidateNodes::candidate_nodes()

Returns a list of nodes that are eligible to become the leader.

elect/0

elect() -> Leader::leader()

Starts the election process by triggering the strategy modules elect() function. The election implementation should only contain the logic for selecting the leader node and returning the leader node name. The elect/0 function is triggered on all nodes automatically by the elector application. This means the strategy implementation does not have to worry about starting the election on all nodes.


Generated by EDoc