# Module fd

- Description
- Data Types
- Function Index
- Function Details

Failure detector based on Guerraoui.

Copyright © 2007-2015 Zuse Institute Berlin

Version: $Id$

Behaviours: `gen_component`.

Authors: Thorsten Schuett (`schuett@zib.de`).

## Description

Failure detector based on Guerraoui.

## Data Types

### event()

    event() = crash | jump | leave

### reason()

    reason() = 'DOWN' | noconnection | term()

### state()

    state() = [HBPid :: pid()]

a list of all hbs processes launched by this fd

## Function Index

init/1 | Initialises the module with an empty state.
report/3 | Reports the calling process' group as being shut down due to a graceful leave operation.
start_gen_component/5 |
start_link/1 | Starts the failure detector server.
subscribe/2 | Generates a failure detector for the calling process on the given pid.
subscribe_refcount/2 | Generates a failure detector for the calling process on the given pid - uses reference counting to be subscribed to a pid only once.
subscriptions/0 | show subscriptions.
unsubscribe/2 | Deletes the failure detector for the given pid.
unsubscribe_refcount/2 | Deletes the failure detector for the given pid - uses reference counting to be subscribed to a pid only once.
update_subscriptions/3 | Unsubscribes Subscriber from the pids in OldPids but not in NewPids and subscribes to the pids in NewPids but not in OldPids (Subscribers can be pid() or an envelop as created by comm:reply_as/3).

## 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

### subscribe/2

    subscribe(Subscriber :: comm:erl_local_pid(),
              WatchedPids :: [comm:mypid()]) ->
                 ok

Generates a failure detector for the calling process on the given pid.

### subscribe_refcount/2

    subscribe_refcount(Subscriber :: comm:erl_local_pid(),
                       WatchedPids :: [comm:mypid()]) ->
                          ok

Generates a failure detector for the calling process on the given pid - uses reference counting to be subscribed to a pid only once. Unsubscribe with unsubscribe_refcount/3!

### unsubscribe/2

    unsubscribe(Subscriber :: comm:erl_local_pid(),
                WatchedPids :: [comm:mypid()]) ->
                   ok

Deletes the failure detector for the given pid.

### unsubscribe_refcount/2

    unsubscribe_refcount(Subscriber :: comm:erl_local_pid(),
                         WatchedPids :: [comm:mypid()]) ->
                            ok

Deletes the failure detector for the given pid - uses reference counting to be subscribed to a pid only once. Subscribe with subscribe_refcount/3!

### update_subscriptions/3

    update_subscriptions(Subscriber :: comm:erl_local_pid(),
                         OldWatchedPids :: [comm:mypid()],
                         NewWatchedPids :: [comm:mypid()]) ->
                            ok

Unsubscribes Subscriber from the pids in OldPids but not in NewPids and subscribes to the pids in NewPids but not in OldPids (Subscribers can be pid() or an envelop as created by comm:reply_as/3).

### report/3

    report(Event :: event(), LocalPids :: [pid()], Data :: term()) ->
              ok

Reports the calling process' group as being shut down due to a graceful leave operation.

### start_link/1

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

Starts the failure detector server

### init/1

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

Initialises the module with an empty state.

### subscriptions/0

    subscriptions() -> ok

show subscriptions

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