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
8e3e205c
Commit
8e3e205c
authored
Jul 19, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: add active_event
parent
81872195
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
gevent/core.pyx
gevent/core.pyx
+15
-0
No files found.
gevent/core.pyx
View file @
8e3e205c
...
...
@@ -65,6 +65,7 @@ cdef extern from "event.h":
int
event_dispatch
()
nogil
int
event_loop
(
int
loop
)
nogil
int
event_pending
(
event_t
*
ev
,
short
,
timeval
*
tv
)
void
event_active
(
event_t
*
ev
,
int
res
,
short
ncalls
)
int
EVLOOP_ONCE
int
EVLOOP_NONBLOCK
...
...
@@ -287,6 +288,20 @@ cdef class signal(event):
self
.
add
(
-
1
)
cdef
class
active_event
(
event
):
"""An event that is scheduled to run in _this_ loop iteration"""
def
__init__
(
self
,
callback
,
*
args
,
**
kwargs
):
self
.
_callback
=
callback
self
.
_arg
=
(
args
,
kwargs
)
evtimer_set
(
&
self
.
ev
,
__simple_handler
,
<
void
*>
self
)
Py_INCREF
(
self
)
event_active
(
&
self
.
ev
,
EV_TIMEOUT
,
1
)
def
add
(
self
,
timeout
=-
1
):
raise
NotImplementedError
def
init
():
"""Initialize event queue."""
event_init
()
...
...
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