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
1963f798
Commit
1963f798
authored
Aug 18, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pool: add and use greenlet_class class variable
parent
cb9e7f63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
gevent/pool.py
gevent/pool.py
+4
-3
No files found.
gevent/pool.py
View file @
1963f798
from
collections
import
deque
from
gevent.hub
import
GreenletExit
,
getcurrent
from
gevent.greenlet
import
spawn
,
joinall
,
Greenlet
from
gevent.greenlet
import
joinall
,
Greenlet
from
gevent.timeout
import
Timeout
...
...
@@ -9,6 +9,7 @@ class GreenletSet(object):
Links to each item and removes it upon notification.
"""
greenlet_class
=
Greenlet
def
__init__
(
self
,
*
args
):
assert
len
(
args
)
<=
1
,
args
...
...
@@ -45,7 +46,7 @@ class GreenletSet(object):
def
spawn
(
self
,
func
,
*
args
,
**
kwargs
):
add
=
self
.
add
p
=
spawn
(
func
,
*
args
,
**
kwargs
)
p
=
s
elf
.
greenlet_class
.
s
pawn
(
func
,
*
args
,
**
kwargs
)
add
(
p
)
return
p
...
...
@@ -134,7 +135,7 @@ class GreenletSet(object):
single argument.
"""
greenlets
=
[
self
.
spawn
(
func
,
item
)
for
item
in
iterable
]
result
=
spawn
(
get_values
,
greenlets
)
result
=
s
elf
.
s
pawn
(
get_values
,
greenlets
)
if
callback
is
not
None
:
result
.
link
(
pass_value
(
callback
))
return
result
...
...
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