MemoryDiscovery class
Discovery service that keeps connections in memory.
Configuration parameters
connection key 1
:- ... connection parameters for key 1
connection key 2
:- ... connection parameters for key N
See IDiscovery See ConnectionParams
Example
var config = ConfigParams.fromTuples(
'key1.host', '10.1.1.100',
'key1.port', '8080',
'key2.host', '10.1.1.100',
'key2.port', '8082'
);
var discovery = new MemoryDiscovery();
discovery.readConnections(config);
var connection await discovery.resolve('123', 'key1');
// Result: host=10.1.1.100;port=8080
- Implemented types
Constructors
- MemoryDiscovery([ConfigParams config ])
- Creates a new instance of discovery service. [...]
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
configure(
ConfigParams config) → void - Configures component by passing configuration parameters. [...]
-
readConnections(
ConfigParams config) → void - Reads connections from configuration parameters. Each section represents an individual Connectionparams [...]
-
register(
String correlationId, String key, ConnectionParams connection) → Future< ConnectionParams> -
Registers connection parameters into the discovery service. [...]
override
-
resolveAll(
String correlationId String key) → Future< List< ConnectionParams> > -
Resolves all connection parameters by their key. [...]
override
-
resolveOne(
String correlationId String key) → Future< ConnectionParams> -
Resolves a single connection parameters by its key. [...]
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited