unbounded<T> static method

(SpscSender<T>, SpscReceiver<T>) unbounded<T>({
  1. bool chunked = true,
  2. String? metricsId,
})

Implementation

static (SpscSender<T>, SpscReceiver<T>) unbounded<T>({
  bool chunked = true,
  String? metricsId,
}) {
  final buf = chunked ? ChunkedBuffer<T>() : UnboundedBuffer<T>();
  final core = StandardChannelCore<T>(
    buf,
    allowMultiSenders: false,
    allowMultiReceivers: false,
    metricsId: metricsId,
  );
  final tx = core.attachSender((c) =>
      SpscSender<T>._(c.id, c.createRemotePort(), metricsId: c.metricsId));
  final rx = core.attachReceiver((c) =>
      SpscReceiver<T>._(c.id, c.createRemotePort(), metricsId: c.metricsId));
  return (tx, rx);
}