Commit 6906344b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 487091b2
......@@ -33,12 +33,21 @@ cdef extern from *:
ctypedef bint cbool "bool"
from libc.stdio cimport printf # XXX temp
from libc.stdint cimport int64_t, uint64_t
# XXX -> pygolang
cdef extern from "wcfs_misc.h" namespace "io" nogil:
error EOF "io::EOF_"
error ErrUnexpectedEOF
cdef extern from "wcfs_misc.h" namespace "zodb" nogil:
ctypedef uint64_t Tid
ctypedef uint64_t Oid
cdef extern from "wcfs_misc.h" nogil:
const Tid TidHead
cdef extern from "wcfs_watchlink.h" nogil:
cppclass _WatchLink:
error close()
......@@ -52,7 +61,9 @@ cdef extern from "wcfs_watchlink.h" nogil:
pair[string, error] sendReq "_ptr()->sendReq" (context.Context ctx, const string &req)
cppclass PinReq:
pass
Oid foid
int64_t blk
Tid at
cdef extern from "wcfs.h" nogil:
......@@ -126,6 +137,20 @@ cdef class PyWatchLink:
cdef class PyPinReq:
cdef PinReq pinreq
property foid:
def __get__(PyPinReq pypin):
return pypin.pinreq.foid # XXX -> oid bytes
property blk:
def __get__(PyPinReq pypin):
return pypin.pinreq.blk
property at:
def __get__(PyPinReq pypin):
at = pypin.pinreq.at
if at == TidHead:
return None
return at # XXX -> tid bytes
# ---- misc ----
......
......@@ -732,6 +732,8 @@ class tWatchLink(wcfs.WatchLink):
t.tdb._wlinks.remove(t)
super(tWatchLink, t).close()
# XXX just wrap req.at with tAt inpace
"""
# recvReq is the same as WatchLink.recvReq but returns tSrvReq instead of PinReq.
def recvReq(t, ctx): # -> tSrvReq | None when EOF
req = super(tWatchLink, t).recvReq(ctx)
......@@ -748,6 +750,7 @@ class tSrvReq(wcfs.PinReq):
if at is not None:
at = tAt(req.wlink.tdb, at)
return foid, blk, at
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment