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
4ac15483
Commit
4ac15483
authored
Apr 21, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: add 'persist' keyword argument to read_event, write_event and readwrite_event
parent
1bd0f8c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
gevent/core.pyx
gevent/core.pyx
+15
-6
No files found.
gevent/core.pyx
View file @
4ac15483
...
@@ -287,24 +287,33 @@ cdef class event:
...
@@ -287,24 +287,33 @@ cdef class event:
cdef
class
read_event
(
event
):
cdef
class
read_event
(
event
):
"""Create a new scheduled event with evtype=EV_READ"""
"""Create a new scheduled event with evtype=EV_READ"""
def
__init__
(
self
,
int
handle
,
callback
,
timeout
=-
1
,
arg
=
None
):
def
__init__
(
self
,
int
handle
,
callback
,
timeout
=-
1
,
arg
=
None
,
persist
=
False
):
event
.
__init__
(
self
,
EV_READ
,
handle
,
callback
,
arg
)
cdef
short
evtype
=
EV_READ
if
persist
:
evtype
=
evtype
|
EV_PERSIST
event
.
__init__
(
self
,
evtype
,
handle
,
callback
,
arg
)
self
.
add
(
timeout
)
self
.
add
(
timeout
)
cdef
class
write_event
(
event
):
cdef
class
write_event
(
event
):
"""Create a new scheduled event with evtype=EV_WRITE"""
"""Create a new scheduled event with evtype=EV_WRITE"""
def
__init__
(
self
,
int
handle
,
callback
,
timeout
=-
1
,
arg
=
None
):
def
__init__
(
self
,
int
handle
,
callback
,
timeout
=-
1
,
arg
=
None
,
persist
=
False
):
event
.
__init__
(
self
,
EV_WRITE
,
handle
,
callback
,
arg
)
cdef
short
evtype
=
EV_WRITE
if
persist
:
evtype
=
evtype
|
EV_PERSIST
event
.
__init__
(
self
,
evtype
,
handle
,
callback
,
arg
)
self
.
add
(
timeout
)
self
.
add
(
timeout
)
class
readwrite_event
(
event
):
class
readwrite_event
(
event
):
"""Create a new scheduled event with evtype=EV_READ|EV_WRITE"""
"""Create a new scheduled event with evtype=EV_READ|EV_WRITE"""
def
__init__
(
self
,
int
handle
,
callback
,
timeout
=-
1
,
arg
=
None
):
def
__init__
(
self
,
int
handle
,
callback
,
timeout
=-
1
,
arg
=
None
,
persist
=
False
):
event
.
__init__
(
self
,
EV_READ
|
EV_WRITE
,
handle
,
callback
,
arg
)
cdef
short
evtype
=
EV_READ
|
EV_WRITE
if
persist
:
evtype
=
evtype
|
EV_PERSIST
event
.
__init__
(
self
,
evtype
,
handle
,
callback
,
arg
)
self
.
add
(
timeout
)
self
.
add
(
timeout
)
...
...
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