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
d4b00714
Commit
d4b00714
authored
Nov 09, 2017
by
Ron Rothman
Committed by
Jason Madden
Nov 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
derive pool.PoolFull from Queue.Full
parent
92287c85
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
src/gevent/pool.py
src/gevent/pool.py
+4
-3
src/greentest/test__pool.py
src/greentest/test__pool.py
+1
-1
No files found.
src/gevent/pool.py
View file @
d4b00714
...
...
@@ -23,6 +23,7 @@ except ImportError:
from
gevent.hub
import
GreenletExit
,
getcurrent
,
kill
as
_kill
from
gevent.greenlet
import
joinall
,
Greenlet
from
gevent.queue
import
Full
as
QueueFull
from
gevent.timeout
import
Timeout
from
gevent.event
import
Event
from
gevent.lock
import
Semaphore
,
DummySemaphore
...
...
@@ -646,7 +647,7 @@ class Failure(object):
raise
self
.
exc
class
Full
(
Exception
):
class
PoolFull
(
QueueFull
):
"""
Raised when a Pool is full and an attempt was made to
add a new greenlet to it.
...
...
@@ -733,7 +734,7 @@ class Pool(Group):
:keyword float timeout: The maximum number of seconds this method will
block, if ``blocking`` is True. (Ignored if ``blocking`` is False.)
Raises ``Timeout`` on timeout, or `Full` if ``blocking`` is False and
Raises ``Timeout`` on timeout, or `
Pool
Full` if ``blocking`` is False and
the pool is full.
.. seealso:: :meth:`Group.add`
...
...
@@ -745,7 +746,7 @@ class Pool(Group):
# We failed to acquire the semaphore.
# If blocking was True, then there was a timeout. If blocking was
# False, then there was no capacity.
raise
Timeout
()
if
blocking
else
Full
()
raise
Timeout
()
if
blocking
else
Pool
Full
()
try
:
Group
.
add
(
self
,
greenlet
)
...
...
src/greentest/test__pool.py
View file @
d4b00714
...
...
@@ -212,7 +212,7 @@ class PoolBasicTests(greentest.TestCase):
second
=
gevent
.
spawn
(
gevent
.
sleep
,
1000
)
try
:
p
.
add
(
first
)
with
self
.
assertRaises
(
pool
.
Full
):
with
self
.
assertRaises
(
pool
.
Pool
Full
):
p
.
add
(
second
,
blocking
=
False
)
finally
:
second
.
kill
()
...
...
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