C# Class Shastra.Hydra.Messaging.Storage.NearestServerProvider

Use the Hydra server with the smallest response time. Switch if another one is more than Tolerance milliseconds faster.
Inheritance: PollingProviderBase
Mostrar archivo Open project: NorthNick/hydra

Public Properties

Property Type Description
Tolerance long

Public Methods

Method Description
NearestServerProvider ( IEnumerable stores ) : System.Collections.Generic

Initialise messaging. Must be called before any attempt to send or listen.

NearestServerProvider ( IEnumerable hydraServers, string database = null, int port = null ) : System.Collections.Generic

Initialise messaging. Must be called before any attempt to send or listen.

NearestServerProvider ( string hydraServer, string database = null, int port = null ) : System.Collections.Generic

Initialise messaging. Must be called before any attempt to send or listen.

Protected Methods

Method Description
InitDistance ( IEnumerable servers ) : void
OnDistanceInfo ( ServerDistanceInfo sdi ) : void

Method Details

InitDistance() protected method

protected InitDistance ( IEnumerable servers ) : void
servers IEnumerable
return void

NearestServerProvider() public method

Initialise messaging. Must be called before any attempt to send or listen.
public NearestServerProvider ( IEnumerable stores ) : System.Collections.Generic
stores IEnumerable Hydra stores to communicate with
return System.Collections.Generic

NearestServerProvider() public method

Initialise messaging. Must be called before any attempt to send or listen.
public NearestServerProvider ( IEnumerable hydraServers, string database = null, int port = null ) : System.Collections.Generic
hydraServers IEnumerable Hydra servers to communicate with
database string Name of the messaging database. Defaults to "hydra"
port int Port number of the messaging database. Defaults to 5984
return System.Collections.Generic

NearestServerProvider() public method

Initialise messaging. Must be called before any attempt to send or listen.
public NearestServerProvider ( string hydraServer, string database = null, int port = null ) : System.Collections.Generic
hydraServer string Hydra server to communicate with
database string Name of the messaging database. Defaults to "hydra"
port int Port number of the messaging database. Defaults to 5984
return System.Collections.Generic

OnDistanceInfo() protected method

protected OnDistanceInfo ( ServerDistanceInfo sdi ) : void
sdi ServerDistanceInfo
return void

Property Details

Tolerance public_oe property

Only change servers if the distance is more than Tolerance milliseconds less than the distance to the current server.
public long Tolerance
return long