register method

Future<ConnectionParams> register(
  1. String? correlationId,
  2. ConnectionParams connection
)

Registers the given connection in all referenced discovery services. This method can be used for dynamic service discovery.

  • correlationId (optional) transaction id to trace execution through call chain.
  • connection a connection to register. Return Future that receives registered connection throws error.

See IDiscovery

Implementation

Future<ConnectionParams> register(
    String? correlationId, ConnectionParams connection) async {
  var result = await _registerInDiscovery(correlationId, connection);
  if (result) {
    _connections.add(connection);
  }
  return connection;
}