

def mode_receive(self, request):
    '\n        This is called by render_POST when the client is telling us\n        that it is ready to receive data as soon as it is available.\n        This is the basis of a long-polling (comet) mechanism: the\n        server will wait to reply until data is available.\n\n        Args:\n            request (Request): Incoming request.\n\n        '
    suid = request.args.get('suid', ['0'])[0]
    if (suid == '0'):
        return ''
    dataentries = self.databuffer.get(suid, [])
    if dataentries:
        return dataentries.pop(0)
    request.notifyFinish().addErrback(self._responseFailed, suid, request)
    if (suid in self.requests):
        self.requests[suid].finish()
    self.requests[suid] = request
    return server.NOT_DONE_YET

dataset/ETHPy150Open evennia/evennia/evennia/server/portal/webclient.py WebClient.mode_receive/original