# Module snapshot_leader

- Description
- Data Types
- Function Index
- Function Details

gen_component for (potential) leader of the snapshot algorithm.

Copyright © 2012-2015 Zuse Institute Berlin

Version: $Id$

Behaviours: `gen_component`.

Authors: Stefan Keidel (`keidel@informatik.hu-berlin.de`).

## Description

gen_component for (potential) leader of the snapshot algorithm

## Data Types

### init_message()

    init_message() =
        {init_snapshot, Client :: comm:erl_local_pid()}

### message()

    message() = init_message() | result_message()

### result_message()

    result_message() =
        {local_snapshot_done,
         From :: comm:erl_local_pid(),
         SnapNumber :: non_neg_integer(),
         DBRange :: intervals:interval(),
         Snapshot :: db_dht:db_as_list()} |
        {local_snapshot_failed,
         From :: comm:erl_local_pid(),
         SnapNumber :: non_neg_integer(),
         Msg :: string()}

## Function Index

init/1 |
on/2 |
start_gen_component/5 |
start_link/1 |

## Function Details

### start_gen_component/5

    start_gen_component(Module :: module(),
                        Handler :: gen_component:handler(),
                        Args :: term(),
                        Options :: [gen_component:option()],
                        Self :: pid()) ->
                           no_return() | ok

### start_link/1

    start_link(DHTNodeGroup :: pid_groups:groupname()) -> {ok, pid()}

### init/1

    init(X1 :: []) -> snapshot_leader_state:state()

### on/2

    on(X1 :: message(), State :: snapshot_leader_state:state()) ->
          snapshot_leader_state:state()

Generated by EDoc, Feb 29 2016, 16:12:17.