Commit e23f0fc1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 17af7916
......@@ -28,6 +28,7 @@ from golang cimport context
from libcpp cimport nullptr_t, nullptr as nil
from libcpp.utility cimport pair
from libcpp.vector cimport vector
cdef extern from *:
ctypedef bint cbool "bool"
......@@ -53,6 +54,7 @@ cdef extern from "wcfs_watchlink.h" nogil:
error closeWrite()
error recvReq(context.Context ctx, PinReq *prx)
pair[string, error] sendReq(context.Context ctx, const string &req)
vector[string] fatalv
cppclass WatchLink (refptr[_WatchLink]):
# WatchLink.X = WatchLink->X in C++
......@@ -60,6 +62,7 @@ cdef extern from "wcfs_watchlink.h" nogil:
error closeWrite "_ptr()->closeWrite"()
error recvReq "_ptr()->recvReq" (context.Context ctx, PinReq *prx)
pair[string, error] sendReq "_ptr()->sendReq" (context.Context ctx, const string &req)
vector[string] fatalv "_ptr()->fatalv"
cppclass PinReq:
Oid foid
......@@ -142,6 +145,12 @@ cdef class PyWatchLink:
return reply
# XXX for tests
property fatalv:
def __get__(PyWatchLink pywlink):
return pywlink.wlink.fatalv
cdef class PyPinReq:
cdef PinReq pinreq
......
......@@ -165,7 +165,7 @@ error _WatchLink::_serveRX(context::Context ctx) { // XXX error -> where ?
if (pkt.stream == 0) { // control/fatal message from wcfs
// XXX print -> receive somewhere? XXX -> recvCtl ?
printf("C: watch : rx fatal: %s\n", l.c_str());
//wlink.fatalv.append(msg);
wlink.fatalv.push_back(pkt.to_string());
continue;
}
......
......@@ -89,6 +89,10 @@ class _WatchLink : public object {
func<void()> _serveCancel;
sync::WorkGroup _serveWG;
// XXX for tests, ad-hoc, racy. TODO rework to send messeges to control channel
public:
vector<string> fatalv;
// don't new - create only via WCFS._openwatch()
private:
_WatchLink();
......
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