addTransform method

void addTransform(
  1. HttpAgentRequestTransformFn fn, [
  2. int? priority
])

Implementation

void addTransform(HttpAgentRequestTransformFn fn, [int? priority]) {
  // Keep the pipeline sorted at all time, by priority.
  priority ??= fn.priority ?? 0;
  final i = _pipeline.indexWhere((x) => (x.priority ?? 0) < priority!);
  fn.priority = priority;
  _pipeline.insert(i >= 0 ? i : _pipeline.length, fn);
}