Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZODB
Commits
2c7a85f3
Commit
2c7a85f3
authored
Sep 08, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pending() method to Connection.
parent
fdd1d394
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
src/ZEO/zrpc/connection.py
src/ZEO/zrpc/connection.py
+33
-0
No files found.
src/ZEO/zrpc/connection.py
View file @
2c7a85f3
...
...
@@ -12,6 +12,7 @@
#
##############################################################################
import
asyncore
import
errno
import
select
import
sys
import
threading
...
...
@@ -331,6 +332,7 @@ class Connection(smac.SizedMessageAsyncConnection):
self
.
thr_async
=
1
def
is_async
(
self
):
# overridden for ManagedConnection
if
self
.
thr_async
:
return
1
else
:
...
...
@@ -367,6 +369,36 @@ class Connection(smac.SizedMessageAsyncConnection):
else
:
asyncore
.
poll
(
0.0
,
self
.
_map
)
def
pending
(
self
):
"""Invoke mainloop until any pending messages are handled."""
if
__debug__
:
log
(
"pending(), async=%d"
%
self
.
is_async
(),
level
=
zLOG
.
TRACE
)
if
self
.
is_async
():
return
# Inline the asyncore poll3 function to know whether any input
# was actually read. Repeat until know input is ready.
# XXX This only does reads.
poll
=
select
.
poll
()
poll
.
register
(
self
.
_fileno
,
select
.
POLLIN
)
# put dummy value in r so we enter the while loop the first time
r
=
[(
self
.
_fileno
,
None
)]
while
r
:
try
:
r
=
poll
.
poll
()
except
select
.
error
,
err
:
if
err
[
0
]
==
errno
.
EINTR
:
continue
else
:
raise
if
r
:
try
:
self
.
handle_read_event
()
except
asyncore
.
ExitNow
:
raise
else
:
self
.
handle_error
()
class
ServerConnection
(
Connection
):
"""Connection on the server side"""
...
...
@@ -423,6 +455,7 @@ class ManagedConnection(Connection):
return
0
def
is_async
(
self
):
# XXX could the check_mgr_async() be avoided on each test?
if
self
.
thr_async
:
return
1
return
self
.
check_mgr_async
()
...
...
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