#-----------------------------------------------------------------------------# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.# All rights reserved.## The full license is in the file LICENSE.txt, distributed with this software.#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Boilerplate#-----------------------------------------------------------------------------from__future__importannotationsimportlogging# isort:skiplog=logging.getLogger(__name__)#-----------------------------------------------------------------------------# Imports#-----------------------------------------------------------------------------# Standard library importsfromtypingimportTYPE_CHECKING,Any# External importsfromtyping_extensionsimportTypedDict# Bokeh importsfrom..exceptionsimportProtocolErrorfrom..messageimportMessageifTYPE_CHECKING:from...document.documentimportDocJson,Document#-----------------------------------------------------------------------------# Globals and constants#-----------------------------------------------------------------------------__all__=('push_doc',)#-----------------------------------------------------------------------------# General API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Dev API#-----------------------------------------------------------------------------classPushDoc(TypedDict):doc:DocJson
[docs]classpush_doc(Message[PushDoc]):''' Define the ``PUSH-DOC`` message for pushing Documents from clients to a Bokeh server. The ``content`` fragment of for this message is has the form: .. code-block:: python { 'doc' : <Document JSON> } '''msgtype='PUSH-DOC'