Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • EventEmitter
    • Discover

Index

Constructors

constructor

Properties

Private bondToAddress

bondToAddress: boolean

Private broadcast

broadcast: BroadcastNetwork

Private broadcastHelloCounter

broadcastHelloCounter: number = 0

Private channels

channels: Set<string> = new Set<string>()

Private checkId

checkId: Timer

Private checkInterval

checkInterval: number = 2000

Private dyunicast

Private helloId

helloId: Timer

Private helloInterval

helloInterval: number = 1000

Private instanceUuid

instanceUuid: string = uuid.v4()

Private masterTimeout

masterTimeout: number = 2000

Private mastersRequired

mastersRequired: number = 1

Private me

me: HelloData = new HelloData()

Private multicast

multicast: MulticastNetwork

Private multicastHelloCounter

multicastHelloCounter: number = 0

Private nodeTimeout

nodeTimeout: number = 2000

Private nodes

nodes: Map<string, Node> = new Map<string, Node>()

Private resetId

resetId: Timer

Private resetInterval

resetInterval: number = 60000

Private running

running: boolean = false

Static defaultMaxListeners

defaultMaxListeners: number

Accessors

id

id:

isMaster

isMaster:

Methods

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

demote

  • demote(permanent: boolean): Promise<void>
  • Parameters

    • permanent: boolean

    Returns Promise<void>

eachNode

  • eachNode(fn: function): void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

hello

  • hello(): Promise<void>

join

  • join(channel: string, fn?: function): boolean
  • Parameters

    • channel: string
    • Optional fn: function
        • (data: any[], obj: any, rinfo: RemoteInfo): void
        • Parameters

          • data: any[]
          • obj: any
          • rinfo: RemoteInfo

          Returns void

    Returns boolean

leave

  • leave(channel: string): boolean

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

on

  • on(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

Private onHello

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

promote

  • promote(): Promise<void>

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

send

  • send(channel: string, ...obj: any[]): Promise<boolean>
  • Parameters

    • channel: string
    • Rest ...obj: any[]

    Returns Promise<boolean>

sendTo

  • sendTo(id: string, maxRetries: number, ...obj: any[]): Promise<boolean>
  • Parameters

    • id: string
    • maxRetries: number
    • Rest ...obj: any[]

    Returns Promise<boolean>

setAdvertisement

  • setAdvertisement(advertisement?: any): Promise<void>
  • Parameters

    • Optional advertisement: any

    Returns Promise<void>

setMasterEligible

  • setMasterEligible(): Promise<void>

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

start

  • start(): Promise<boolean>

stop

  • stop(): boolean

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static Private weight

  • weight(): number

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc