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
1586dcdc
Commit
1586dcdc
authored
Aug 14, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pool: add pass_value auxiliary class (this fixes apply_async)
parent
e1a136cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
gevent/pool.py
gevent/pool.py
+28
-0
No files found.
gevent/pool.py
View file @
1586dcdc
...
...
@@ -210,3 +210,31 @@ class Pool(GreenletSet):
def
get_values
(
greenlets
):
joinall
(
greenlets
)
return
[
x
.
value
for
x
in
greenlets
]
class
pass_value
(
object
):
__slots__
=
[
'callback'
]
def
__init__
(
self
,
callback
):
self
.
callback
=
callback
def
__call__
(
self
,
source
):
if
source
.
successful
():
self
.
callback
(
source
.
value
)
def
__hash__
(
self
):
return
hash
(
self
.
callback
)
def
__eq__
(
self
,
other
):
return
self
.
callback
==
getattr
(
other
,
'callback'
,
other
)
def
__str__
(
self
):
return
str
(
self
.
callback
)
def
__repr__
(
self
):
return
repr
(
self
.
callback
)
def
__getattr__
(
self
,
item
):
assert
item
!=
'callback'
return
getattr
(
self
.
callback
,
item
)
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