chat_hub = connection.hub('chat')

def message_received(message):
    print('Hub: New message.', message)
chat_hub.client.on('message_received', message_received)
chat_hub.server.invoke('send_message', 'Hello!')
chat_hub.client.off('message_received', message_received)
connection.close()
Использование сервера SignalR из кода Python