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
ce67f064
Commit
ce67f064
authored
Feb 08, 1999
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update documentation to reflect changes to Queue.py by Tim Peters.
parent
9e1721fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
15 deletions
+29
-15
Doc/lib/libqueue.tex
Doc/lib/libqueue.tex
+29
-15
No files found.
Doc/lib/libqueue.tex
View file @
ce67f064
...
...
@@ -25,10 +25,15 @@ zero, the queue size is infinite.
\end{classdesc}
\begin{excdesc}
{
Empty
}
Exception raised when non-blocking get (e.g.
\method
{
get
_
nowait()
}
) is
called on a
\class
{
Queue
}
object which is empty, or for which the
emptyiness cannot be determined (i.e. because the appropriate locks
cannot be acquired).
Exception raised when non-blocking
\method
{
get()
}
(or
\method
{
get
_
nowait()
}
) is called on a
\class
{
Queue
}
object which is
empty or locked.
\end{excdesc}
\begin{excdesc}
{
Full
}
Exception raised when non-blocking
\method
{
put()
}
(or
\method
{
get
_
nowait()
}
) is called on a
\class
{
Queue
}
object which is
full or locked.
\end{excdesc}
\subsection
{
Queue Objects
}
...
...
@@ -41,31 +46,40 @@ is not described here. See the source code for details. The public
methods are:
\begin{methoddesc}
{
qsize
}{}
Return
s
the approximate size of the queue. Because of multithreading
Return the approximate size of the queue. Because of multithreading
semantics, this number is not reliable.
\end{methoddesc}
\begin{methoddesc}
{
empty
}{}
Return
s
\code
{
1
}
if the queue is empty,
\code
{
0
}
otherwise. Because
Return
\code
{
1
}
if the queue is empty,
\code
{
0
}
otherwise. Because
of multithreading semantics, this is not reliable.
\end{methoddesc}
\begin{methoddesc}
{
full
}{}
Return
s
\code
{
1
}
if the queue is full,
\code
{
0
}
otherwise. Because of
Return
\code
{
1
}
if the queue is full,
\code
{
0
}
otherwise. Because of
multithreading semantics, this is not reliable.
\end{methoddesc}
\begin{methoddesc}
{
put
}{
item
}
Puts
\var
{
item
}
into the queue.
\begin{methoddesc}
{
put
}{
item
\optional
{
, block
}}
Put
\var
{
item
}
into the queue. If optional argument
\var
{
block
}
is 1
(the default), block if necessary until a free slot is available.
Otherwise (
\var
{
block
}
is 0), put
\var
{
item
}
on the queue if a free
slot is immediately available, else raise the
\exception
{
Full
}
exception.
\end{methoddesc}
\begin{methoddesc}
{
put
_
nowait
}{
item
}
Equivalent to
\code
{
put(
\var
{
item
}
, 0)
}
.
\end{methoddesc}
\begin{methoddesc}
{
get
}{}
Gets and returns an item from the queue, blocking if necessary until
one is available.
\begin{methoddesc}
{
get
}{
\optional
{
block
}}
Remove and return an item from the queue. If optional argument
\var
{
block
}
is 1 (the default), block if necessary until an item is
available. Otherwise (
\var
{
block
}
is 0), return an item if one is
immediately available, else raise the
\exception
{
Empty
}
exception.
\end{methoddesc}
\begin{methoddesc}
{
get
_
nowait
}{}
Gets and returns an item from the queue if one is immediately
available. Raises an
\exception
{
Empty
}
exception if the queue is
empty or if the queue's emptiness cannot be determined.
Equivalent to
\code
{
get(0)
}
.
\end{methoddesc}
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