Example #1
0
File: files.py Project: dckc/typhon
    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))
Example #2
0
    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))
Example #3
0
 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)
Example #4
0
File: files.py Project: dckc/typhon
 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)
Example #5
0
File: files.py Project: dckc/typhon
    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))
Example #6
0
File: files.py Project: dckc/typhon
 def queueClose(self):
     ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, ruv.fsDiscard)
     self._state = self.CLOSED
Example #7
0
File: files.py Project: dckc/typhon
 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
Example #8
0
 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
Example #9
0
 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)
Example #10
0
    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))
Example #11
0
 def queueClose(self):
     ruv.fsClose(self.vat.uv_loop, self.fs, self.fd, ruv.fsDiscard)
     self._state = self.CLOSED
Example #12
0
 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
Example #13
0
 def _cleanup(self):
     ruv.fsClose(self._vat.uv_loop, self._fs, self._fd, ruv.fsDiscard)
     self.closed = True
Example #14
0
 def _cleanup(self):
     uv_loop = self._vat.uv_loop
     ruv.fsClose(uv_loop, self._fs, self._fd, ruv.fsDiscard)
     ruv.freeBuf(self._buf)