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(
    'connections.key1.host', '10.1.1.100',
    'connections.key1.port', '8080',
    'connections.key2.host', '10.1.1.100',
    'connections.key2.port', '8082'
);

var discovery = new MemoryDiscovery();
discovery.configure(config);

var connection await discovery.resolveOne('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.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

configure(ConfigParams config) → void
Configures component by passing configuration parameters.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
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
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited