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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
c49c7b5c
Commit
c49c7b5c
authored
Apr 23, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8df86e84
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
9 deletions
+3
-9
wcfs/wcfs.go
wcfs/wcfs.go
+1
-6
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+2
-3
No files found.
wcfs/wcfs.go
View file @
c49c7b5c
...
@@ -1409,7 +1409,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
...
@@ -1409,7 +1409,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
for
blk
,
rev
:=
range
toPin
{
for
blk
,
rev
:=
range
toPin
{
blk
:=
blk
blk
:=
blk
rev
:=
rev
rev
:=
rev
fmt
.
Printf
(
"S: watch: -> pin #%d @%s
\n
"
,
blk
,
rev
)
//
fmt.Printf("S: watch: -> pin #%d @%s\n", blk, rev)
wg
.
Go
(
func
()
error
{
wg
.
Go
(
func
()
error
{
return
w
.
pin
(
ctx
,
blk
,
rev
)
return
w
.
pin
(
ctx
,
blk
,
rev
)
})
})
...
@@ -1546,22 +1546,17 @@ func (wlink *WatchLink) handleWatch(ctx context.Context, stream uint64, msg stri
...
@@ -1546,22 +1546,17 @@ func (wlink *WatchLink) handleWatch(ctx context.Context, stream uint64, msg stri
return
err
return
err
}
}
fmt
.
Printf
(
"S: watch: AAA
\n
"
)
err
=
wlink
.
setupWatch
(
ctx
,
foid
,
at
)
err
=
wlink
.
setupWatch
(
ctx
,
foid
,
at
)
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Printf
(
"S: watch: QQQ: %s
\n
"
,
err
)
fmt
.
Printf
(
"S: watch: QQQ: %s
\n
"
,
err
)
return
err
return
err
}
}
fmt
.
Printf
(
"S: watch: BBB
\n
"
)
err
=
wlink
.
send
(
ctx
,
stream
,
"ok"
)
err
=
wlink
.
send
(
ctx
,
stream
,
"ok"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
fmt
.
Printf
(
"S: watch: CCC
\n
"
)
return
nil
return
nil
}
}
...
...
wcfs/wcfs_test.py
View file @
c49c7b5c
...
@@ -620,20 +620,19 @@ def test_wcfs():
...
@@ -620,20 +620,19 @@ def test_wcfs():
@
func
@
func
def
_
():
def
_
():
defer
(
done
.
close
)
defer
(
done
.
close
)
print
(
'C: aaa'
)
pinv
=
w
.
expectPin
([(
zf
,
2
,
at1
),
(
zf
,
3
,
at0
)])
pinv
=
w
.
expectPin
([(
zf
,
2
,
at1
),
(
zf
,
3
,
at0
)])
#pinv = w.expectPin({zf: [(2, at1), (3, at0)]}) XXX <- this way better? (sugar)
#pinv = w.expectPin({zf: [(2, at1), (3, at0)]}) XXX <- this way better? (sugar)
#print('C: bbb')
#print('C: bbb')
#print('C: ccc', pinv)
#print('C: ccc', pinv)
for
p
in
pinv
:
for
p
in
pinv
:
p
.
reply
(
b"ack"
)
p
.
reply
(
b"ack"
)
print
(
'C: eee'
)
go
(
_
)
go
(
_
)
assert
w
.
sendReq
(
b"watch %s @%s"
%
(
h
(
zf
.
_p_oid
),
h
(
at1
)))
==
"ok"
assert
w
.
sendReq
(
b"watch %s @%s"
%
(
h
(
zf
.
_p_oid
),
h
(
at1
)))
==
"ok"
print
(
'
\
n
BBB
\
n
'
)
done
.
recv
()
done
.
recv
()
print
(
'
\
n
CCC
\
n
'
)
print
(
'
\
n
CCC
\
n
'
)
return
# XXX test watch with all at variants
# XXX test watch with all at variants
# XXX both from scratch and going e.g. at1 -> at2 -> at3
# XXX both from scratch and going e.g. at1 -> at2 -> at3
# XXX going not only up, but also down at1 <- at2 <- at3
# XXX going not only up, but also down at1 <- at2 <- at3
...
...
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