Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Kirill Smelkov
gevent
Commits
ab5b3850
Commit
ab5b3850
authored
Apr 07, 2011
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
socket.py: rename an argument of _wait() from 'io' to 'watcher'
parent
36409a82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
gevent/socket.py
gevent/socket.py
+4
-6
No files found.
gevent/socket.py
View file @
ab5b3850
...
...
@@ -301,27 +301,25 @@ class socket(object):
result
+=
' timeout='
+
str
(
self
.
timeout
)
return
result
def
_wait
(
self
,
io
,
timeout_exc
=
timeout
(
'timed out'
)):
"""Block the current greenlet until *
io* is ready
.
def
_wait
(
self
,
watcher
,
timeout_exc
=
timeout
(
'timed out'
)):
"""Block the current greenlet until *
watcher* has pending events
.
If *timeout* is non-negative, then *timeout_exc* is raised after *timeout* second has passed.
By default *timeout_exc* is ``socket.timeout('timed out')``.
If :func:`cancel_wait` is called, raise ``socket.error(EBADF, 'File descriptor was closed in another greenlet')``.
"""
assert
io
.
callback
is
None
,
'This socket is already used by another greenlet: %r'
%
(
io
.
callback
,
)
assert
watcher
.
callback
is
None
,
'This socket is already used by another greenlet: %r'
%
(
watcher
.
callback
,
)
if
self
.
timeout
is
not
None
:
timeout
=
Timeout
.
start_new
(
self
.
timeout
,
timeout_exc
)
else
:
timeout
=
None
try
:
self
.
hub
.
wait
(
io
)
self
.
hub
.
wait
(
watcher
)
finally
:
if
timeout
is
not
None
:
timeout
.
cancel
()
# rename "io" to "watcher" because wait() works with any watcher
# make wait() a Hub's method
def
accept
(
self
):
sock
=
self
.
_sock
while
True
:
...
...
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