#-----------------------------------------------------------------------------# Copyright (c) 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 importsfromtypingimportAny# Bokeh importsfrom...core.typesimportIDfrom..messageimportEmpty,Message#-----------------------------------------------------------------------------# Globals and constants#-----------------------------------------------------------------------------__all__=('ok',)#-----------------------------------------------------------------------------# General API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Dev API#-----------------------------------------------------------------------------
[docs]classok(Message[Empty]):''' Define the ``OK`` message for acknowledging successful handling of a previous message. The ``content`` fragment of for this message is empty. '''msgtype='OK'
[docs]@classmethoddefcreate(cls,request_id:ID,**metadata:Any)->ok:''' Create an ``OK`` message Args: request_id (str) : The message ID for the message the precipitated the OK. Any additional keyword arguments will be put into the message ``metadata`` fragment as-is. '''header=cls.create_header(request_id=request_id)returncls(header,metadata,Empty())