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
13dae8ec
Commit
13dae8ec
authored
Aug 13, 2011
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 'backend_fd', 'fdchangecnt', 'timercnt' properties to loop
parent
87659599
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
12 deletions
+29
-12
gevent/core_.pyx
gevent/core_.pyx
+26
-12
gevent/libev.pxd
gevent/libev.pxd
+3
-0
No files found.
gevent/core_.pyx
View file @
13dae8ec
...
...
@@ -215,6 +215,12 @@ def time(self):
return
libev
.
ev_time
()
m4_define
(
LOOP_PROPERTY
,
``
property
$
1
:
def
__get__
(
self
):
return
self
.
_ptr
.
$
1
''
)
cdef
public
class
loop
[
object
PyGeventLoopObject
,
type
PyGeventLoop_Type
]:
cdef
libev
.
ev_loop
*
_ptr
cdef
public
object
error_handler
...
...
@@ -340,11 +346,8 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
libev
.
ev_now_update
(
self
.
_ptr
)
def
__repr__
(
self
):
args
=
(
self
.
__class__
.
__name__
,
id
(
self
),
self
.
default
,
self
.
backend
)
result
=
'<%s at 0x%x default=%r backend=%r'
%
args
#ifdef EV_STANDALONE
result
+=
' activecnt=%r'
%
self
.
activecnt
#endif
result
=
'<%s at 0x%x'
%
(
self
.
__class__
.
__name__
,
id
(
self
))
result
+=
self
.
_format
()
return
result
+
'>'
property
default
:
...
...
@@ -376,13 +379,6 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
return
value
return
backend
#ifdef EV_STANDALONE
property
activecnt
:
def
__get__
(
self
):
return
self
.
_ptr
.
activecnt
#endif
def
io
(
self
,
int
fd
,
int
events
,
ref
=
True
):
return
io
(
self
,
fd
,
events
,
ref
)
...
...
@@ -415,6 +411,24 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
result
.
start
(
func
,
*
args
)
return
result
#ifdef EV_STANDALONE
def
_format
(
self
):
args
=
(
self
.
default
,
self
.
backend
,
self
.
activecnt
,
self
.
backend_fd
,
self
.
fdchangecnt
,
self
.
timercnt
)
return
' default=%r backend=%r activecnt=%r backend_fd=%r fdchangecnt=%r timercnt=%r'
%
args
#else
def
_format
(
self
):
args
=
(
self
.
default
,
self
.
backend
)
return
' default=%r backend=%r'
%
args
#endif
#ifdef EV_STANDALONE
LOOP_PROPERTY
(
activecnt
)
LOOP_PROPERTY
(
backend_fd
)
LOOP_PROPERTY
(
fdchangecnt
)
LOOP_PROPERTY
(
timercnt
)
#endif
m4_define
(
PYTHON_INCREF
,
``
if
not
self
.
_flags
&
1
:
Py_INCREF
(
<
PyObjectPtr
>
self
)
self
.
_flags
|=
1
''
)
m4_dnl
...
...
gevent/libev.pxd
View file @
13dae8ec
...
...
@@ -56,6 +56,9 @@ cdef extern from "libev.h":
struct
ev_loop
:
int
activecnt
int
backend_fd
int
fdchangecnt
int
timercnt
struct
ev_io
:
int
fd
...
...
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