Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
0a7da733
Commit
0a7da733
authored
Nov 01, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
362dbf6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
7 deletions
+26
-7
wcfs/internal/_wcfs.pyx
wcfs/internal/_wcfs.pyx
+22
-3
wcfs/internal/wcfs_watchlink.cpp
wcfs/internal/wcfs_watchlink.cpp
+3
-3
wcfs/internal/wcfs_watchlink.h
wcfs/internal/wcfs_watchlink.h
+1
-1
No files found.
wcfs/internal/_wcfs.pyx
View file @
0a7da733
...
...
@@ -41,6 +41,8 @@ cdef extern from "wcfs_misc.h" nogil:
cdef
extern
from
"wcfs_watchlink.h"
nogil
:
cppclass
WatchLink
:
error
close
()
#error recvReq(ctx, PinReq *rx_into)
pair
[
string
,
error
]
sendReq
(
ctx
,
const
string
&
req
)
ctypedef
WatchLink
*
pWatchLink
# https://github.com/cython/cython/issues/534
...
...
@@ -69,7 +71,7 @@ cdef class PyWatchLink:
with
nogil
:
_
=
wcfs_openwatch_pyexc
(
&
pywc
.
wc
)
pywlink
.
wlink
=
_
.
first
err
=
_
.
second
err
=
_
.
second
if
err
!=
nil
:
raise
RuntimeError
(
err
.
Error
())
# XXX exc class?
...
...
@@ -83,6 +85,20 @@ cdef class PyWatchLink:
raise
RuntimeError
(
err
.
Error
())
# XXX exc class?
# XXX recvReq
def
sendReq
(
PyWatchLink
pywlink
,
ctx
,
string
req
):
# -> reply(string)
with
nogil
:
_
=
wlink_sendReq_pyexc
(
pywlink
.
wlink
,
ctx
,
req
)
reply
=
_
.
first
err
=
_
.
second
if
err
!=
nil
:
raise
RuntimeError
(
err
.
Error
())
# XXX -> Xpy(err) ? pyraiseIf(err) ?
return
reply
cdef
class
PyPinReq
:
pass
...
...
@@ -93,8 +109,11 @@ cdef class PyPinReq:
cdef
nogil
:
pair
[
pWatchLink
,
error
]
wcfs_openwatch_pyexc
(
WCFS
*
wcfs
)
except
+
topyexc
:
return
wcfs
.
_openwatch
()
error
wlink_close_pyexc
(
WatchLink
*
wlink
)
except
+
topyexc
:
return
wlink
.
close
()
pair
[
pWatchLink
,
error
]
wcfs_openwatch_pyexc
(
WCFS
*
wcfs
)
except
+
topyexc
:
return
w
cfs
.
_openwatch
(
)
pair
[
string
,
error
]
wlink_sendReq_pyexc
(
WatchLink
*
wlink
,
ctx
,
const
string
&
req
)
except
+
topyexc
:
return
w
link
.
sendReq
(
ctx
,
req
)
wcfs/internal/wcfs_watchlink.cpp
View file @
0a7da733
...
...
@@ -209,7 +209,7 @@ error WatchLink::_write(const string &pkt) {
// sendReq sends client -> server request and returns server reply.
// XXX -> reply | None when EOF
tuple
<
string
,
error
>
WatchLink
::
sendReq
(
context
::
Context
*
ctx
,
const
string
&
req
)
{
pair
<
string
,
error
>
WatchLink
::
sendReq
(
context
::
Context
*
ctx
,
const
string
&
req
)
{
WatchLink
*
wlink
=
this
;
// XXX err ctx
...
...
@@ -224,11 +224,11 @@ tuple<string, error> WatchLink::sendReq(context::Context *ctx, const string &req
rxq
.
recvs
(
&
rx
),
// 1
});
if
(
_
==
0
)
return
make_
tuple
(
""
,
ctx
->
err
());
return
make_
pair
(
""
,
ctx
->
err
());
// XXX check for EOF
string
reply
=
rx
.
to_string
();
return
make_
tuple
(
reply
,
nil
);
return
make_
pair
(
reply
,
nil
);
}
tuple
<
/*rxq*/
chan
<
rxPkt
>
,
error
>
WatchLink
::
_sendReq
(
context
::
Context
*
ctx
,
const
string
&
req
)
{
...
...
wcfs/internal/wcfs_watchlink.h
View file @
0a7da733
...
...
@@ -88,7 +88,7 @@ public:
friend
pair
<
WatchLink
*
,
error
>
WCFS
::
_openwatch
();
error
close
();
error
recvReq
(
context
::
Context
*
ctx
,
PinReq
*
rx_into
);
tuple
<
string
,
error
>
sendReq
(
context
::
Context
*
ctx
,
const
string
&
req
);
pair
<
string
,
error
>
sendReq
(
context
::
Context
*
ctx
,
const
string
&
req
);
private:
void
_closeTX
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment