Commit 09310101 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9c0ea7e9
...@@ -60,7 +60,9 @@ from ZODB.utils import z64, u64, p64 ...@@ -60,7 +60,9 @@ from ZODB.utils import z64, u64, p64
from zodbtools.util import ashex as h, fromhex from zodbtools.util import ashex as h, fromhex
from .internal import mm from .internal import mm
from .internal._wcfs import PyWatchLink as WatchLink from .internal._wcfs import \
PyWatchLink as WatchLink, \
PyPinReq as PinReq \
from six import reraise from six import reraise
......
...@@ -25,3 +25,7 @@ ...@@ -25,3 +25,7 @@
cdef class PyWatchLink: cdef class PyWatchLink:
pass pass
cdef class PyPinReq:
pass
...@@ -732,16 +732,17 @@ class tWatchLink(wcfs.WatchLink): ...@@ -732,16 +732,17 @@ class tWatchLink(wcfs.WatchLink):
t.tdb._wlinks.remove(t) t.tdb._wlinks.remove(t)
super(tWatchLink, t).close() super(tWatchLink, t).close()
# recvReq is the same as WatchLink.recvReq but returns tSrvReq instead of SrvReq. # recvReq is the same as WatchLink.recvReq but returns tSrvReq instead of PinReq.
def recvReq(t, ctx): # -> tSrvReq | None when EOF def recvReq(t, ctx): # -> tSrvReq | None when EOF
req = super(tWatchLink, t).recvReq(ctx) req = super(tWatchLink, t).recvReq(ctx)
if req is not None: if req is not None:
assert req.__class__ is wcfs.SrvReq assert req.__class__ is wcfs.PinReq
req.__class__ = tSrvReq req.__class__ = tSrvReq
return req return req
class tSrvReq(wcfs.SrvReq): class tSrvReq(wcfs.PinReq):
# _parse is the same as SrvReq._parse, but returns at wrapped with tAt. # _parse is the same as PinReq._parse, but returns at wrapped with tAt.
# XXX -> just wrap `at`
def _parse(req): # -> (foid, blk, at|None) def _parse(req): # -> (foid, blk, at|None)
foid, blk, at = super(tSrvReq, req)._parse() foid, blk, at = super(tSrvReq, req)._parse()
if at is not None: if at is not None:
......
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