lib/LeaderElection.js
function LeaderElection(client, path, id) {
  EventEmitter.call(this);

  /**
   * Ref. to client.
   *
   * @type {Rorschach}
   */
  this.client = client;


  /**
   * ZooKeeper path where participants' nodes exist.
   *
   * @type {String}
   */
  this.path = path;


  /**
   * Id of participant. It's kept in node.
   *
   * @type {String}
   */
  this.id = id;


  /**
   * Leadership state
   *
   * @type {Boolean}
   */
  this.isLeader = false;


  /**
   * Initial state.
   *
   * @type {State}
   */
  this.state = State.LATENT;
}
function LeaderElection(client, path, id) {
  EventEmitter.call(this);

  /**
   * Ref. to client.
   *
   * @type {Rorschach}
   */
  this.client = client;


  /**
   * ZooKeeper path where participants' nodes exist.
   *
   * @type {String}
   */
  this.path = path;


  /**
   * Id of participant. It's kept in node.
   *
   * @type {String}
   */
  this.id = id;


  /**
   * Leadership state
   *
   * @type {Boolean}
   */
  this.isLeader = false;


  /**
   * Initial state.
   *
   * @type {State}
   */
  this.state = State.LATENT;
}
function LeaderElection ( client , path , id ) { EventEmitter . call ( this ) ; /**
   * Ref. to client.
   *
   * @type {Rorschach}
   */ this . client = client ; /**
   * ZooKeeper path where participants' nodes exist.
   *
   * @type {String}
   */ this . path = path ; /**
   * Id of participant. It's kept in node.
   *
   * @type {String}
   */ this . id = id ; /**
   * Leadership state
   *
   * @type {Boolean}
   */ this . isLeader = false ; /**
   * Initial state.
   *
   * @type {State}
   */ this . state = State . LATENT ; }
Leader election participant.

@constructor
@extends {EventEmitter}
@param {Rorschach} client Rorschach instance
@param {String} path Election path
@param {String} id Participant id
Leader election participant .