#NEWLINE# @ apiproxy_stub . Synchronized #NEWLINE# def _Dynamic_SendChannelMessage( self , request , response ) : #NEWLINE# #INDENT# 'Implementation of channel.send_message.\n\n    Queues a message to be retrieved by the client when it polls.\n\n    Args:\n      request: A SendMessageRequest.\n      response: A VoidProto.\n    ' #NEWLINE# client_id = self . client_id_from_token ( request . application_key ( ) ) #NEWLINE# if ( client_id is None ) : #NEWLINE# #INDENT# client_id = request . application_key ( ) #NEWLINE# #UNINDENT# if ( not request . message ( ) ) : #NEWLINE# #INDENT# raise apiproxy_errors . ApplicationError ( channel_service_pb . ChannelServiceError . BAD_MESSAGE ) #NEWLINE# #UNINDENT# if ( client_id in self . _connected_channel_messages ) : #NEWLINE# #INDENT# self . _log ( 'Sending a message (%s) to channel with key (%s)' , request . message ( ) , client_id ) #NEWLINE# self . _connected_channel_messages [ client_id ] . append ( request . message ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _log ( 'SKIPPING message (%s) to channel with key (%s): no clients connected' , request . message ( ) , client_id )