Commit e23f0fc1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

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