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
7f403c3e
Commit
7f403c3e
authored
May 19, 2018
by
Jason Madden
Committed by
GitHub
May 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1218 from gevent/issue1217
Allow weakreferences to Queue objects. Fixes #1217.
parents
6728bd08
c08b9edf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
4 deletions
+17
-4
CHANGES.rst
CHANGES.rst
+3
-2
src/gevent/_queue.pxd
src/gevent/_queue.pxd
+3
-1
src/gevent/queue.py
src/gevent/queue.py
+2
-0
src/greentest/test__queue.py
src/greentest/test__queue.py
+9
-1
No files found.
CHANGES.rst
View file @
7f403c3e
...
@@ -7,13 +7,14 @@
...
@@ -7,13 +7,14 @@
1.3.2 (unreleased)
1.3.2 (unreleased)
==================
==================
- Nothing changed yet.
- Allow weak refeneces to :class:`gevent.queue.Queue`. Reported in
:issue:`1217` by githrdw.
1.3.1 (2018-05-18)
1.3.1 (2018-05-18)
==================
==================
-
Fix
weak references to :class:`gevent.event.Event`. Reported in
-
Allow
weak references to :class:`gevent.event.Event`. Reported in
:issue:`1211` by Matias Guijarro.
:issue:`1211` by Matias Guijarro.
- Fix embedded uses of :func:`gevent.Greenlet.spawn`, especially under
- Fix embedded uses of :func:`gevent.Greenlet.spawn`, especially under
...
...
src/gevent/_queue.pxd
View file @
7f403c3e
...
@@ -16,14 +16,15 @@ cdef class ItemWaiter(Waiter):
...
@@ -16,14 +16,15 @@ cdef class ItemWaiter(Waiter):
cdef
readonly
queue
cdef
readonly
queue
cdef
class
Queue
:
cdef
class
Queue
:
cdef
__weakref__
cdef
readonly
hub
cdef
readonly
hub
cdef
readonly
queue
cdef
readonly
queue
cdef
Py_ssize_t
_maxsize
cdef
getters
cdef
getters
cdef
putters
cdef
putters
cdef
_event_unlock
cdef
_event_unlock
cdef
Py_ssize_t
_maxsize
cpdef
_get
(
self
)
cpdef
_get
(
self
)
cpdef
_put
(
self
,
item
)
cpdef
_put
(
self
,
item
)
...
@@ -61,6 +62,7 @@ cdef class JoinableQueue(Queue):
...
@@ -61,6 +62,7 @@ cdef class JoinableQueue(Queue):
cdef
class
Channel
:
cdef
class
Channel
:
cdef
__weakref__
cdef
readonly
getters
cdef
readonly
getters
cdef
readonly
putters
cdef
readonly
putters
cdef
readonly
hub
cdef
readonly
hub
...
...
src/gevent/queue.py
View file @
7f403c3e
...
@@ -113,6 +113,7 @@ class Queue(object):
...
@@ -113,6 +113,7 @@ class Queue(object):
'hub'
,
'hub'
,
'_event_unlock'
,
'_event_unlock'
,
'queue'
,
'queue'
,
'__weakref__'
,
)
)
def
__init__
(
self
,
maxsize
=
None
,
items
=
(),
_warn_depth
=
2
):
def
__init__
(
self
,
maxsize
=
None
,
items
=
(),
_warn_depth
=
2
):
...
@@ -558,6 +559,7 @@ class Channel(object):
...
@@ -558,6 +559,7 @@ class Channel(object):
'putters'
,
'putters'
,
'hub'
,
'hub'
,
'_event_unlock'
,
'_event_unlock'
,
'__weakref__'
,
)
)
def
__init__
(
self
,
maxsize
=
1
):
def
__init__
(
self
,
maxsize
=
1
):
...
...
src/greentest/test__queue.py
View file @
7f403c3e
...
@@ -377,8 +377,16 @@ class TestJoinEmpty(TestCase):
...
@@ -377,8 +377,16 @@ class TestJoinEmpty(TestCase):
q
=
queue
.
JoinableQueue
()
q
=
queue
.
JoinableQueue
()
q
.
join
()
q
.
join
()
class
AbstractTestWeakRefMixin
(
object
):
class
TestGetInterrupt
(
AbstractGenericGetTestCase
):
def
test_weak_reference
(
self
):
import
weakref
one
=
self
.
_makeOne
()
ref
=
weakref
.
ref
(
one
)
self
.
assertIs
(
one
,
ref
())
class
TestGetInterrupt
(
AbstractTestWeakRefMixin
,
AbstractGenericGetTestCase
):
Timeout
=
Empty
Timeout
=
Empty
...
...
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