I need to be able to call a async function in a signal when CTRL-C is pressed. I'm not sure how to do this.
Non working example:
async def close_handler(sig ,frame):
global users
print("exit")
await closeProximityChat()
writeUsers(users)
sys.exit(0)
signal.signal(signal.SIGINT, await close_handler)