#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- import logging # isort:skip log = logging.getLogger(__name__) #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Bokeh imports from ..message import Message #----------------------------------------------------------------------------- # Globals and constants #----------------------------------------------------------------------------- __all__ = ( 'ok', ) #----------------------------------------------------------------------------- # General API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Dev API #----------------------------------------------------------------------------- [docs]class ok(Message): ''' Define the ``OK`` message for acknowledging successful handling of a previous message. The ``content`` fragment of for this message is empty. ''' msgtype = 'OK' [docs] @classmethod def create(cls, request_id, **metadata): ''' 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) return cls(header, metadata, {}) #----------------------------------------------------------------------------- # Private API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Code #-----------------------------------------------------------------------------