def kill(pid: int): """Terminate a running process""" os.kill(pid, signal.SIGSTOP) log.info('Kill process {0}'.format(pid))
def sleep(pid: int): """Tell a process to sleep""" os.waitpid(pid, os.WSTOPPED) log.info('Wait process {0}'.format(pid))
def wake(pid: int): """Continue a stopped process""" os.kill(pid, signal.SIGCONT) log.info('Continue process {0}'.format(pid))
async def on_ready(): logging.info(f"Online : {datetime.now().isoformat()}")
async def on_message_edit(before, after): logging.info(f"Changed : {before} -> {after}")
async def on_message_delete(message): logging.info(f"Deleted : {message}")
async def on_message(message): checkedMessage = CheckedMessage(message) logging.info(checkedMessage())
async def on_resumed(): logging.info(f"Resumed : {datetime.now().isoformat()}")