Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0d64dc03
Commit
0d64dc03
authored
Jun 28, 2008
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change references to Queue module to queue in multiprocessing docs
parent
5a7b8a85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
Doc/library/multiprocessing.rst
Doc/library/multiprocessing.rst
+18
-18
No files found.
Doc/library/multiprocessing.rst
View file @
0d64dc03
...
@@ -50,7 +50,7 @@ processes:
...
@@ -50,7 +50,7 @@ processes:
**
Queues
**
**
Queues
**
The
:
class
:`
Queue
`
class
is
a
near
clone
of
:
class
:`
Q
ueue
.
Queue
`.
For
The
:
class
:`
Queue
`
class
is
a
near
clone
of
:
class
:`
q
ueue
.
Queue
`.
For
example
::
example
::
from
multiprocessing
import
Process
,
Queue
from
multiprocessing
import
Process
,
Queue
...
@@ -414,10 +414,10 @@ For passing messages one can use :func:`Pipe` (for a connection between two
...
@@ -414,10 +414,10 @@ For passing messages one can use :func:`Pipe` (for a connection between two
processes) or a queue (which allows multiple producers and consumers).
processes) or a queue (which allows multiple producers and consumers).
The :class:`Queue` and :class:`JoinableQueue` types are multi-producer,
The :class:`Queue` and :class:`JoinableQueue` types are multi-producer,
multi-consumer FIFO queues modelled on the :class:`
Q
ueue.Queue` class in the
multi-consumer FIFO queues modelled on the :class:`
q
ueue.Queue` class in the
standard library. They differ in that :class:`Queue` lacks the
standard library. They differ in that :class:`Queue` lacks the
:meth:`~
Queue.Queue.task_done` and :meth:`~Q
ueue.Queue.join` methods introduced
:meth:`~
queue.Queue.task_done` and :meth:`~q
ueue.Queue.join` methods introduced
into Python 2.5'
s
:
class
:`
Q
ueue
.
Queue
`
class
.
into Python 2.5'
s
:
class
:`
q
ueue
.
Queue
`
class
.
If
you
use
:
class
:`
JoinableQueue
`
then
you
**
must
**
call
If
you
use
:
class
:`
JoinableQueue
`
then
you
**
must
**
call
:
meth
:`
JoinableQueue
.
task_done
`
for
each
task
removed
from
the
queue
or
else
the
:
meth
:`
JoinableQueue
.
task_done
`
for
each
task
removed
from
the
queue
or
else
the
...
@@ -429,10 +429,10 @@ Note that one can also create a shared queue by using a manager object -- see
...
@@ -429,10 +429,10 @@ Note that one can also create a shared queue by using a manager object -- see
..
note
::
..
note
::
:
mod
:`
multiprocessing
`
uses
the
usual
:
exc
:`
Q
ueue
.
Empty
`
and
:
mod
:`
multiprocessing
`
uses
the
usual
:
exc
:`
q
ueue
.
Empty
`
and
:
exc
:`
Q
ueue
.
Full
`
exceptions
to
signal
a
timeout
.
They
are
not
available
in
:
exc
:`
q
ueue
.
Full
`
exceptions
to
signal
a
timeout
.
They
are
not
available
in
the
:
mod
:`
multiprocessing
`
namespace
so
you
need
to
import
them
from
the
:
mod
:`
multiprocessing
`
namespace
so
you
need
to
import
them
from
:
mod
:`
Q
ueue
`.
:
mod
:`
q
ueue
`.
..
warning
::
..
warning
::
...
@@ -477,11 +477,11 @@ For an example of the usage of queues for interprocess communication see
...
@@ -477,11 +477,11 @@ For an example of the usage of queues for interprocess communication see
locks
/
semaphores
.
When
a
process
first
puts
an
item
on
the
queue
a
feeder
locks
/
semaphores
.
When
a
process
first
puts
an
item
on
the
queue
a
feeder
thread
is
started
which
transfers
objects
from
a
buffer
into
the
pipe
.
thread
is
started
which
transfers
objects
from
a
buffer
into
the
pipe
.
The
usual
:
exc
:`
Queue
.
Empty
`
and
:
exc
:`
Q
ueue
.
Full
`
exceptions
from
the
The
usual
:
exc
:`
queue
.
Empty
`
and
:
exc
:`
q
ueue
.
Full
`
exceptions
from
the
standard
library
's :mod:`Queue` module are raised to signal timeouts.
standard
library
's :mod:`Queue` module are raised to signal timeouts.
:class:`Queue` implements all the methods of :class:`
Q
ueue.Queue` except for
:class:`Queue` implements all the methods of :class:`
q
ueue.Queue` except for
:meth:`~
Queue.Queue.task_done` and :meth:`~Q
ueue.Queue.join`.
:meth:`~
queue.Queue.task_done` and :meth:`~q
ueue.Queue.join`.
.. method:: qsize()
.. method:: qsize()
...
@@ -506,10 +506,10 @@ For an example of the usage of queues for interprocess communication see
...
@@ -506,10 +506,10 @@ For an example of the usage of queues for interprocess communication see
Put item into the queue. If the optional argument *block* is ``True``
Put item into the queue. If the optional argument *block* is ``True``
(the default) and *timeout* is ``None`` (the default), block if necessary until
(the default) and *timeout* is ``None`` (the default), block if necessary until
a free slot is available. If *timeout* is a positive number, it blocks at
a free slot is available. If *timeout* is a positive number, it blocks at
most *timeout* seconds and raises the :exc:`
Q
ueue.Full` exception if no
most *timeout* seconds and raises the :exc:`
q
ueue.Full` exception if no
free slot was available within that time. Otherwise (*block* is
free slot was available within that time. Otherwise (*block* is
``False``), put an item on the queue if a free slot is immediately
``False``), put an item on the queue if a free slot is immediately
available, else raise the :exc:`
Q
ueue.Full` exception (*timeout* is
available, else raise the :exc:`
q
ueue.Full` exception (*timeout* is
ignored in that case).
ignored in that case).
.. method:: put_nowait(item)
.. method:: put_nowait(item)
...
@@ -521,10 +521,10 @@ For an example of the usage of queues for interprocess communication see
...
@@ -521,10 +521,10 @@ For an example of the usage of queues for interprocess communication see
Remove and return an item from the queue. If optional args *block* is
Remove and return an item from the queue. If optional args *block* is
``True`` (the default) and *timeout* is ``None`` (the default), block if
``True`` (the default) and *timeout* is ``None`` (the default), block if
necessary until an item is available. If *timeout* is a positive number,
necessary until an item is available. If *timeout* is a positive number,
it blocks at most *timeout* seconds and raises the :exc:`
Q
ueue.Empty`
it blocks at most *timeout* seconds and raises the :exc:`
q
ueue.Empty`
exception if no item was available within that time. Otherwise (block is
exception if no item was available within that time. Otherwise (block is
``False``), return an item if one is immediately available, else raise the
``False``), return an item if one is immediately available, else raise the
:exc:`
Q
ueue.Empty` exception (*timeout* is ignored in that case).
:exc:`
q
ueue.Empty` exception (*timeout* is ignored in that case).
.. method:: get_nowait()
.. method:: get_nowait()
get_no_wait()
get_no_wait()
...
@@ -532,7 +532,7 @@ For an example of the usage of queues for interprocess communication see
...
@@ -532,7 +532,7 @@ For an example of the usage of queues for interprocess communication see
Equivalent to ``get(False)``.
Equivalent to ``get(False)``.
:class:`multiprocessing.Queue` has a few additional methods not found in
:class:`multiprocessing.Queue` has a few additional methods not found in
:class:`
Q
ueue.Queue` which are usually unnecessary:
:class:`
q
ueue.Queue` which are usually unnecessary:
.. method:: close()
.. method:: close()
...
@@ -1176,7 +1176,7 @@ their parent process exits. The manager classes are defined in the
...
@@ -1176,7 +1176,7 @@ their parent process exits. The manager classes are defined in the
.. method:: Queue([maxsize])
.. method:: Queue([maxsize])
Create a shared :class:`
Q
ueue.Queue` object and return a proxy for it.
Create a shared :class:`
q
ueue.Queue` object and return a proxy for it.
.. method:: RLock()
.. method:: RLock()
...
@@ -1264,8 +1264,8 @@ Running the following commands creates a server for a single shared queue which
...
@@ -1264,8 +1264,8 @@ Running the following commands creates a server for a single shared queue which
remote
clients
can
access
::
remote
clients
can
access
::
>>>
from
multiprocessing
.
managers
import
BaseManager
>>>
from
multiprocessing
.
managers
import
BaseManager
>>>
import
Q
ueue
>>>
import
q
ueue
>>>
queue
=
Q
ueue
.
Queue
()
>>>
queue
=
q
ueue
.
Queue
()
>>>
class
QueueManager
(
BaseManager
):
pass
>>>
class
QueueManager
(
BaseManager
):
pass
...
...
>>>
QueueManager
.
register
(
'getQueue'
,
callable
=
lambda
:
queue
)
>>>
QueueManager
.
register
(
'getQueue'
,
callable
=
lambda
:
queue
)
...
...
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