attachRequest method

  1. @override
Future<void> attachRequest(
  1. Request request,
  2. TA args,
  3. void sendResponse()
)

attachRequest is called by the client when it wants us to attach to an existing app. This will only be called once (and only one of this or launchRequest will be called).

Implementation

@override
Future<void> attachRequest(
  Request request,
  TA args,
  void Function() sendResponse,
) async {
  this.args = args as DartCommonLaunchAttachRequestArguments;
  isAttach = true;
  _subscribeToOutputStreams = true;

  // When attaching to a process, suppress auto-resuming isolates until the
  // first time the user resumes anything.
  isolateManager.autoResumeStartingIsolates = false;

  // Common setup.
  await _prepareForLaunchOrAttach(null);

  // Delegate to the sub-class to attach to the process.
  await attachImpl();

  sendResponse();
}