async def send_users(message): protocol.response( message, Message( 'users', { 'users': [{ 'name': 'Dr. Clef', 'age': 'CLASSIFIED' }, { 'name': 'Dr. Bright', 'age': 'CLASSIFIED' }] }))
async def get_users(_): message = await protocol.send(Message('get_users')) print(message.data['users']) protocol.response(message, Message('received_users'))
async def echo(message): protocol.response(message, Message('echo_resp', {'msg': message.data['msg']}))
async def event_type(message): protocol.response(message, Message(message.type, {'msg': 'it works'}))