threadsRequest method

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

Handles a request from the client for the list of threads.

This is usually called after we sent a StoppedEvent to the client notifying it that execution of an isolate has paused and it wants to populate the threads view.

Implementation

@override
Future<void> threadsRequest(
  Request request,
  void args,
  void Function(ThreadsResponseBody) sendResponse,
) async {
  final threads = [
    for (final thread in isolateManager.threads)
      Thread(
        id: thread.threadId,
        name: thread.isolate.name ?? '<unnamed isolate>',
      )
  ];
  sendResponse(ThreadsResponseBody(threads: threads));
}