Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
8b16fc79
Commit
8b16fc79
authored
Jan 11, 2001
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added sync method in support of the ZODB Connection sync method.
parent
1cc1e605
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+3
-1
src/ZEO/zrpc.py
src/ZEO/zrpc.py
+14
-2
No files found.
src/ZEO/ClientStorage.py
View file @
8b16fc79
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Network ZODB storage client
"""
__version__
=
'$Revision: 1.2
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
6
$'
[
11
:
-
2
]
import
struct
,
time
,
os
,
socket
,
string
,
Sync
,
zrpc
,
ClientCache
import
tempfile
,
Invalidator
,
ExtensionClass
,
thread
...
...
@@ -559,6 +559,8 @@ class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage):
try
:
return
self
.
_call
(
'versions'
,
max
)
finally
:
self
.
_lock_release
()
def
sync
(
self
):
self
.
_call
.
sync
()
def
getWakeup
(
_w
=
[]):
if
_w
:
return
_w
[
0
]
import
trigger
...
...
src/ZEO/zrpc.py
View file @
8b16fc79
...
...
@@ -85,13 +85,13 @@
"""Simple rpc mechanisms
"""
__version__
=
"$Revision: 1.1
0
$"
[
11
:
-
2
]
__version__
=
"$Revision: 1.1
1
$"
[
11
:
-
2
]
from
ZODB.cPickle
import
loads
from
ZODB
import
cPickle
from
thread
import
allocate_lock
from
smac
import
SizedMessageAsyncConnection
import
socket
,
string
,
struct
,
asyncore
,
sys
,
time
import
socket
,
string
,
struct
,
asyncore
,
sys
,
time
,
select
TupleType
=
type
(())
from
zLOG
import
LOG
,
TRACE
,
DEBUG
,
INFO
...
...
@@ -163,6 +163,17 @@ class asyncRPC(SizedMessageAsyncConnection):
if
key
==
self
.
_fileno
:
return
self
raise
KeyError
,
key
def
sync
(
self
):
if
self
.
__map
:
return
# in async mode
# Ick, I have to do my own select loop, which sucks
while
1
:
try
:
r
,
w
,
e
=
select
.
select
([
self
.
_fileno
],[],[],
0.0
)
except
select
.
error
,
v
:
if
v
[
0
]
!=
EINTR
:
raise
if
r
:
asyncore
.
poll
(
0.0
,
self
)
else
:
break
def
readLoop
(
self
):
la
=
self
.
__la
while
not
la
(
0
):
...
...
@@ -176,6 +187,7 @@ class asyncRPC(SizedMessageAsyncConnection):
self
.
__map
=
1
self
.
__Wakeup
=
Wakeup
def
__call__
(
self
,
*
args
):
args
=
dump
(
args
,
1
)
...
...
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