stop method

Future<void> stop()

Implementation

Future<void> stop() async {
  if (!_started) {
    return;
  }
  _started = false;
  await _failActiveRequestStreams(error: RoomServerException("remote toolkit stopped"));
  try {
    await _unregister();
  } finally {
    room.protocol.removeHandler("agent.tool_call.$name", _toolCall);
    room.protocol.removeHandler("agent.tool_call_request_chunk.$name", _toolCallRequestChunk);
  }
}