'Send a complete message. This class will take care of splitting it
into appropriate frames automatically. `buf` must be a file like object.'

def send_websocket_message(self, buf, wakeup=True):

    self.sendq.put(MessageWriter(buf))
    self.wait_for = RDWR
    if wakeup:
        self.wakeup()
