docstr: A base class for a Perspective client implementation that offers
  a fully async API through an event loop.
  
  Child classes must implement `send()`, which defines how a message
  should be delivered to the Perspective server implementation.
docstr_tok: ["A","base","class","for","a","Perspective","client","implementation","that","offers","a","fully","async","API","through","an","event","loop",".","Child","classes","must","implement","`","send","(",")","`",",","which","defines","how","a","message","should","be","delivered","to","the","Perspective","server","implementation","."]
code: def __init__(self):
      """A base class for a Perspective client implementation that offers
      a fully async API through an event loop.
  
      Child classes must implement `send()`, which defines how a message
      should be delivered to the Perspective server implementation.
      """
      self._msg_id = 0
      self._handlers = {}
  
      # Because we can't reuse a `Future` in Python, we can't just resolve
      # the same `Future` over and over again in order to actually execute
      # on_update/on_delete etc. callbacks.
      #
      # Instead, we store the callbacks on the client and use `callback_id`
      # to access callback references. `self._callback_cache` is a map of
      # callbacks to integer IDs, which is required to allow the `remove_{}`
      # APIs to receive a callable to remove.
      #
      # To execute the callbacks themselves, we can look up the callback
      # in `self._callback_id_cache` (a dict of integer ID to callback),
      # and execute it in the `_handle` method.
      self._callback_cache = {}
      self._callback_id_cache = {}
      self._callback_id = 0
  
file_path: perspective/python/perspective/perspective/client/base.py
imports: import asyncio
  from random import random
  from ..core.exception import PerspectiveError
  from .table_api import PerspectiveTableProxy
  from .table_api import table
  from .view_api import PerspectiveViewProxy
label_desc: Use image node_id 1 to create a new PerspectiveClient object from inherited base classes: object with example: obj = PerspectiveClient()