def succeed(self): # Clean up libuv stuff. ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, ruv.fsDiscard) # Finally, resolve. buf = "".join(self.pieces) self.resolver.resolve(BytesObject(buf))
def written(self, size): self.pos += size self.data = self.data[size:] if self.data: self.queueWrite() else: # Finished writing; let's move on to the rename. ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, closeSetContentsCB)
def fail(self, reason): # Clean up libuv stuff. ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, ruv.fsDiscard) # And resolve. self.resolver.smash(StrObject(u"libuv error: %s" % reason))
def queueClose(self): ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, ruv.fsDiscard) self._state = self.CLOSED
def close(self): uv_loop = self.vat.uv_loop ruv.fsClose(uv_loop, self.fs, self.fd, ruv.fsDiscard) ruv.freeBuf(self.buf) self.drain = None
def _cleanup(self): fs = ruv.alloc_fs() ruv.stashFS(fs, (self._vat, self)) ruv.fsClose(self._vat.uv_loop, fs, self._fd, ruv.fsUnstashAndDiscard) self.closed = True
def _cleanup(self): uv_loop = self._vat.uv_loop fs = ruv.alloc_fs() ruv.stashFS(fs, (self._vat, self)) ruv.fsClose(uv_loop, fs, self._fd, ruv.fsUnstashAndDiscard) ruv.freeBuf(self._buf)
def _cleanup(self): ruv.fsClose(self._vat.uv_loop, self._fs, self._fd, ruv.fsDiscard) self.closed = True
def _cleanup(self): uv_loop = self._vat.uv_loop ruv.fsClose(uv_loop, self._fs, self._fd, ruv.fsDiscard) ruv.freeBuf(self._buf)