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
6645a704
Commit
6645a704
authored
Aug 16, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename core.read and core.write to core.read_event / core.write_event
parent
2d9f8d73
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
gevent/core.pyx
gevent/core.pyx
+2
-2
gevent/select.py
gevent/select.py
+3
-2
gevent/socket.py
gevent/socket.py
+2
-2
No files found.
gevent/core.pyx
View file @
6645a704
...
...
@@ -265,14 +265,14 @@ cdef class event:
self
.
cancel
()
cdef
class
read
(
event
):
cdef
class
read
_event
(
event
):
def
__init__
(
self
,
int
handle
,
callback
,
timeout
=-
1
,
arg
=
None
):
event
.
__init__
(
self
,
EV_READ
,
handle
,
callback
,
arg
)
self
.
add
(
timeout
)
cdef
class
write
(
event
):
cdef
class
write
_event
(
event
):
def
__init__
(
self
,
int
handle
,
callback
,
timeout
=-
1
,
arg
=
None
):
event
.
__init__
(
self
,
EV_WRITE
,
handle
,
callback
,
arg
)
...
...
gevent/select.py
View file @
6645a704
...
...
@@ -14,6 +14,7 @@ def get_fileno(obj):
def
select
(
read_list
,
write_list
,
error_list
,
timeout
=
None
):
# QQQ error_list is ignored
hub
=
get_hub
()
current
=
getcurrent
()
assert
hub
is
not
current
,
'do not call blocking functions from the mainloop'
...
...
@@ -28,9 +29,9 @@ def select(read_list, write_list, error_list, timeout=None):
current
.
switch
(([],
[],
[]))
for
r
in
read_list
:
allevents
.
append
(
core
.
read
(
get_fileno
(
r
),
callback
,
arg
=
r
))
allevents
.
append
(
core
.
read
_event
(
get_fileno
(
r
),
callback
,
arg
=
r
))
for
w
in
write_list
:
allevents
.
append
(
core
.
write
(
get_fileno
(
r
),
callback
,
arg
=
w
))
allevents
.
append
(
core
.
write
_event
(
get_fileno
(
r
),
callback
,
arg
=
w
))
timeout
=
Timeout
(
timeout
)
try
:
...
...
gevent/socket.py
View file @
6645a704
...
...
@@ -51,7 +51,7 @@ def _wait_helper(ev, evtype):
def
wait_reader
(
fileno
,
timeout
=-
1
,
timeout_exc
=
_socket
.
timeout
):
evt
=
core
.
read
(
fileno
,
_wait_helper
,
timeout
,
(
getcurrent
(),
timeout_exc
))
evt
=
core
.
read
_event
(
fileno
,
_wait_helper
,
timeout
,
(
getcurrent
(),
timeout_exc
))
try
:
switch_result
=
get_hub
().
switch
()
assert
evt
is
switch_result
,
'Invalid switch into wait_reader(): %r'
%
(
switch_result
,
)
...
...
@@ -60,7 +60,7 @@ def wait_reader(fileno, timeout=-1, timeout_exc=_socket.timeout):
def
wait_writer
(
fileno
,
timeout
=-
1
,
timeout_exc
=
_socket
.
timeout
):
evt
=
core
.
write
(
fileno
,
_wait_helper
,
timeout
,
(
getcurrent
(),
timeout_exc
))
evt
=
core
.
write
_event
(
fileno
,
_wait_helper
,
timeout
,
(
getcurrent
(),
timeout_exc
))
try
:
switch_result
=
get_hub
().
switch
()
assert
evt
is
switch_result
,
'Invalid switch into wait_writer(): %r'
%
(
switch_result
,
)
...
...
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