RpcClient constructor

RpcClient({
  1. required Uri baseUri,
  2. required RpcTransport transport,
  3. Serializer? serializer,
  4. RpcHeadersProvider? headersProvider,
  5. String functionPath = '/__odroe/functions',
  6. int maxResponseFrameBytes = defaultMaxResponseFrameBytes,
})

Creates a client for one Odroe server origin.

Implementation

RpcClient({
  required this.baseUri,
  required this.transport,
  Serializer? serializer,
  this.headersProvider,
  String functionPath = '/__odroe/functions',
  this.maxResponseFrameBytes = defaultMaxResponseFrameBytes,
}) : serializer = serializer ?? Serializer(),
     functionPath = normalizeFunctionPath(functionPath, allowRelative: true) {
  if (maxResponseFrameBytes <= 0) {
    throw ArgumentError.value(
      maxResponseFrameBytes,
      'maxResponseFrameBytes',
      'Must be greater than zero.',
    );
  }
}