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
939cb70b
Commit
939cb70b
authored
Aug 13, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Event: rename link to rawlink and make it not create an auxilary greenlet
parent
c435b2fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
gevent/event.py
gevent/event.py
+7
-6
No files found.
gevent/event.py
View file @
939cb70b
...
...
@@ -19,10 +19,12 @@ class Event(object):
if
self
.
_value
is
not
_NONE
:
return
self
.
_value
def
link
(
self
,
callback
):
def
raw
link
(
self
,
callback
):
if
self
.
_value
is
_NONE
:
self
.
_links
.
add
(
callback
)
else
:
# QQQ switch won't work as a callback!
# QQQ should I schedule the callback here too, like Greenlet.rawlink does?
callback
(
self
)
def
unlink
(
self
,
callback
):
...
...
@@ -43,9 +45,8 @@ class Event(object):
assert
getcurrent
()
is
get_hub
()
while
self
.
_links
:
link
=
self
.
_links
.
pop
()
g
=
greenlet
(
link
)
try
:
g
.
switch
(
self
)
link
(
self
)
except
:
traceback
.
print_exc
()
try
:
...
...
@@ -59,7 +60,7 @@ class Event(object):
return
self
.
_value
elif
block
:
switch
=
getcurrent
().
switch
self
.
link
(
switch
)
self
.
raw
link
(
switch
)
try
:
# result = None
# if not isinstance(timeout, Timeout): # need Timeout.start() method to implement this
...
...
@@ -85,7 +86,7 @@ class Event(object):
return
else
:
switch
=
getcurrent
().
switch
self
.
link
(
switch
)
self
.
raw
link
(
switch
)
try
:
t
=
Timeout
(
timeout
)
try
:
...
...
@@ -157,7 +158,7 @@ def waitall(events):
put
=
queue
.
put
try
:
for
event
in
events
:
event
.
link
(
put
)
event
.
raw
link
(
put
)
for
_
in
xrange
(
len
(
events
)):
queue
.
get
()
finally
:
...
...
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