registerParamScheme<T> method

  1. @protected
VoidCallback registerParamScheme<T>(
  1. Comparable key
)

Register a param scheme for the module.

T can be optional.

Unregistry by calling the return value VoidCallback.

Implementation

@protected
VoidCallback registerParamScheme<T>(Comparable key) {
  if (_paramSchemes.keys.contains(key)) {
    throw ThrioException('$T is already registered for key ${_paramSchemes[key]}');
  }
  final callback = _paramSchemes.registry(key, T);
  return () {
    callback();
    final scs = paramStreamCtrls.remove(key);
    if (scs != null && scs.isNotEmpty) {
      for (final sc in scs) {
        sc.close();
      }
    }
  };
}