class_docstr: A Bokeh server may be expected to receive any of the following protocol
  messages:
  
  * ``PATCH-DOC``
  * ``PULL-DOC-REQ``
  * ``PUSH-DOC``
  * ``SERVER-INFO-REQ``
  
  The job of ``ProtocolHandler`` is to direct incoming messages to the right
  specialized handler for each message type. When the server receives a new
  message on a connection it will call ``handler`` with the message and the
  connection that the message arrived on. Most messages are ultimately
  handled by the ``ServerSession`` class, but some simpler messages types
  such as ``SERVER-INFO-REQ`` may be handled directly by ``ProtocolHandler``.
  
  Any unexpected messages will result in a ``ProtocolError``.
class_docstr_tok: ["A","Bokeh","server","may","be","expected","to","receive","any","of","the","following","protocol","messages",":","*","``","PATCH-DOC","``","*","``","PULL-DOC-REQ","``","*","``","PUSH-DOC","``","*","``","SERVER-INFO-REQ","``","The","job","of","``","ProtocolHandler","``","is","to","direct","incoming","messages","to","the","right","specialized","handler","for","each","message","type",".","When","the","server","receives","a","new","message","on","a","connection","it","will","call","``","handler","``","with","the","message","and","the","connection","that","the","message","arrived","on",".","Most","messages","are","ultimately","handled","by","the","``","ServerSession","``","class",",","but","some","simpler","messages","types","such","as","``","SERVER-INFO-REQ","``","may","be","handled","directly","by","``","ProtocolHandler","``",".","Any","unexpected","messages","will","result","in","a","``","ProtocolError","``","."]
code: def __init__(self) -> None:
      self._handlers = {}
  
      self._handlers["PULL-DOC-REQ"] = ServerSession.pull
      self._handlers["PUSH-DOC"] = ServerSession.push
      self._handlers["PATCH-DOC"] = ServerSession.patch
      self._handlers["SERVER-INFO-REQ"] = self._server_info_req
  
imports: from __future__ import annotations
  import logging
  from typing import Any, Callable
  from ..protocol.exceptions import ProtocolError
  from .session import ServerSession
label_desc: Use image node_id 1 to create a new ProtocolHandler object  with example: obj = ProtocolHandler()