Home Reference Source
public class | source

AbstractNetwork

Extends:

events~EventEmitter → AbstractNetwork

AbstractNetwork represents an abstract network layer

Constructor Summary

Public Constructor
public

constructor(options: Object)

Constructor

Member Summary

Public Members
public get

id: String: *

Return a unique identifier of the peer

public get

The in-view ID of the peer in the network

public get

The out-view ID of the peer in the network

public get

rps: *: *

The Random Peer Sampling Network itself

Private Members
private

_id: *

private
private

_rps: *

Method Summary

Public Methods
public

getNeighbours(limit: integer): string[]

Get the IDs of all available neighbours

Private Methods
private

_buildRPS(options: Object): *

Build the RPS for this network.

Public Constructors

public constructor(options: Object) source

Constructor

Params:

NameTypeAttributeDescription
options Object

Additional options used to build the network

Public Members

public get id: String: * source

Return a unique identifier of the peer

Return:

String

The identifier of the peer

public get inviewId: string source

The in-view ID of the peer in the network

Return:

string

The in-view ID of the peer

public get outviewId: string source

The out-view ID of the peer in the network

Return:

string

The out-view ID of the peer

public get rps: *: * source

The Random Peer Sampling Network itself

Return:

*

The Random Peer Sampling Network

Private Members

private _id: * source

private _options: * source

private _rps: * source

Public Methods

public getNeighbours(limit: integer): string[] source

Get the IDs of all available neighbours

Params:

NameTypeAttributeDescription
limit integer

Max number of neighbours to look for

Return:

string[]

Set of IDs for all available neighbours

Private Methods

private _buildRPS(options: Object): * source

Build the RPS for this network. Subclasses of AbstractNetwork must implement this method.

Params:

NameTypeAttributeDescription
options Object

Options used to build the RPS

Return:

*

The network used as RPS/overlay