A representation of a leaseholder who is identified by a username, hostname, and process id (PID). This implementation is serializable to/from a JSON object and is comparable to other leaseholders.

Accessors

Methods

  • Compares this leaseholder to another leaseholder to determine if they are equal. Two leaseholders are equal if their username, hostname, and process id are the same.

    Parameters

    Returns boolean

    true if the leaseholders are equal; false otherwise.

  • Determines if the process associated with this leaseholder is still alive. This method will return false if the process is not alive or an error occurs while checking the process status.

    Returns boolean

    true if the process is alive; false otherwise.

  • Compares this leaseholder to another leaseholder to determine if they are the same machine. Two leaseholders are the same machine if their username and hostname are the same.

    Parameters

    Returns boolean

    true if the leaseholders are the same machine; false otherwise.

  • Returns a plain object representation of this leaseholder. This object may be serialized to JSON.

    Returns any

    a plain object representation of this leaseholder.

  • Creates a new leaseholder with the given username. The hostname is set to the current machine's hostname and the process id is set to the current process's PID.

    Parameters

    • username: string

      the user's identity.

    Returns LeaseHolder

    a new leaseholder instance.