lock method

void lock()

Lock the interceptor.

Once the request/response/error interceptor is locked, the incoming request/response/error will wait before entering the interceptor until the interceptor is unlocked.

Implementation

void lock() {
  if (!locked) {
    _completer = Completer();
    _lock = _completer.future;
  }
}