def lineSend(self, suid, string, data=None):
        request = self.requests.get(suid)
        if request:
            # we have a request waiting. Return immediately.
            request.write(jsonify({'msg': string, 'data': data}))
            request.finish()
            del self.requests[suid]
        else:
            # no waiting request. Store data in buffer
            dataentries = self.databuffer.get(suid, [])
            dataentries.append(jsonify({'msg': string, 'data': data}))
            self.databuffer[suid] = dataentries
This adds the data to the buffer and/or sends it to the client
dataset/ETHPy150Open evennia/evennia/evennia/server/portal/webclient.py/WebClient.lineSend