def METHOD_NAME(self, cmd, name):
    self.ensure_running()
    msg = '{0}:{1}\n'.format(cmd, name).encode('ascii')
    if len(name) > 512:
        # posix guarantees that writes to a pipe of less than PIPE_BUF
        # bytes are atomic, and that PIPE_BUF >= 512
        raise ValueError('name too long')
    nbytes = os.write(self._fd, msg)
    assert nbytes == len(msg)