class_docstr: A channel to communicate with NNI manager.
  
  Each NNI experiment has a channel URL for tuner/assessor/strategy algorithm.
  The channel can only be connected once, so for each Python side :class:`~nni.experiment.Experiment` object,
  there should be exactly one corresponding ``TunerCommandChannel`` instance.
  
  :meth:`connect` must be invoked before sending or receiving data.
  
  The constructor does not have side effect so ``TunerCommandChannel`` can be created anywhere.
  But :meth:`connect` requires an initialized NNI manager, or otherwise the behavior is unpredictable.
  
  :meth:`_send` and :meth:`_receive` are underscore-prefixed because their signatures are scheduled to change by v3.0.
  
  Parameters
  ----------
  url
      The command channel URL.
      For now it must be like ``"ws://localhost:8080/tuner"`` or ``"ws://localhost:8080/url-prefix/tuner"``.
class_docstr_tok: ["A","channel","to","communicate","with","NNI","manager",".","Each","NNI","experiment","has","a","channel","URL","for","tuner\/assessor\/strategy","algorithm",".","The","channel","can","only","be","connected","once",",","so","for","each","Python","side",":","class",":","`","~nni.experiment.Experiment","`","object",",","there","should","be","exactly","one","corresponding","``","TunerCommandChannel","``","instance",".",":","meth",":","`","connect","`","must","be","invoked","before","sending","or","receiving","data",".","The","constructor","does","not","have","side","effect","so","``","TunerCommandChannel","``","can","be","created","anywhere",".","But",":","meth",":","`","connect","`","requires","an","initialized","NNI","manager",",","or","otherwise","the","behavior","is","unpredictable",".",":","meth",":","`","_send","`","and",":","meth",":","`","_receive","`","are","underscore-prefixed","because","their","signatures","are","scheduled","to","change","by","v3.0",".","Parameters","--","--","--","--","--","url","The","command","channel","URL",".","For","now","it","must","be","like","``","``","ws",":","\/\/localhost:8080\/tuner","''","``","or","``","``","ws",":","\/\/localhost:8080\/url-prefix\/tuner","''","``","."]
docstr: Register a callback for UpdateSearchSpace command.
  
  Parameters
  ----------
  callback
      A callback function that takes a :class:`UpdateSearchSpace` as argument.
docstr_tok: ["Register","a","callback","for","UpdateSearchSpace","command",".","Parameters","--","--","--","--","--","callback","A","callback","function","that","takes","a",":","class",":","`","UpdateSearchSpace","`","as","argument","."]
code: def on_update_search_space(
      self, callback: Callable[[UpdateSearchSpace], None]
  ) -> None:
      """Register a callback for UpdateSearchSpace command.
  
      Parameters
      ----------
      callback
          A callback function that takes a :class:`UpdateSearchSpace` as argument.
      """
      self._callbacks[UpdateSearchSpace.command_type].append(callback)
  
imports: from __future__ import annotations
  import logging
  import os
  from collections import defaultdict
  from threading import Event
  from typing import Any, Callable
  from nni.common.serializer import dump, load, PayloadTooLarge
  from nni.runtime.command_channel.websocket import WsChannelClient
  from nni.typehint import Parameters
  from .command_type import CommandType, TunerIncomingCommand, Initialize, RequestTrialJobs, UpdateSearchSpace, ReportMetricData, TrialEnd, Terminate
label_desc: Use image node_id 12 for calling the TunerCommandChannel obj's underlying member method code with example usage: obj.on_update_search_space(callback) without return types