INNER CODE UNIT · Python

remove_room_user

leonh/redis-streams-fastapi-chat · chat.py:267

async def remove_room_user(chat_info: dict, pool):
    #removed = await pool.srem(chat_info['room']+":users", chat_info['username'])
    removed = await pool.srem(cvar_tenant.get()+":users", cvar_chat_info.get()['username'])
    return removed


async def room_users(chat_info: dict, pool):
    #users = await pool.smembers(chat_info['room']+":users")
    users = await pool.smembers(cvar_tenant.get()+":users")
    print(len(users))
    return users


async def announce(pool, chat_info: dict, action: str):
    """
    add an announcement event onto the redis chat stream
    """
    users = await room_users(chat_info, pool)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…