@@ -7,15 +7,15 @@ open Fable.Core
77
88[<Import( " Queue" , " queue" ) >]
99type Queue < 'T >() =
10- /// Return the approximate size of the queue. Note, qsize() > 0 doesn’ t guarantee that a subsequent get() will not
10+ /// Return the approximate size of the queue. Note, qsize() > 0 doesn' t guarantee that a subsequent get() will not
1111 /// block, nor will qsize() < maxsize guarantee that put() will not block.
1212 member x.qsize () : int = nativeOnly
13- /// Return True if the queue is empty, False otherwise. If empty() returns True it doesn’ t guarantee that a
14- /// subsequent call to put() will not block. Similarly, if empty() returns False it doesn’ t guarantee that a
13+ /// Return True if the queue is empty, False otherwise. If empty() returns True it doesn' t guarantee that a
14+ /// subsequent call to put() will not block. Similarly, if empty() returns False it doesn' t guarantee that a
1515 /// subsequent call to get() will not block.
1616 member x.empty () : bool = nativeOnly
17- /// Return True if the queue is full, False otherwise. If full() returns True it doesn’ t guarantee that a subsequent
18- /// call to get() will not block. Similarly, if full() returns False it doesn’ t guarantee that a subsequent call to
17+ /// Return True if the queue is full, False otherwise. If full() returns True it doesn' t guarantee that a subsequent
18+ /// call to get() will not block. Similarly, if full() returns False it doesn' t guarantee that a subsequent call to
1919 /// put() will not block.
2020 member x.full () : bool = nativeOnly
2121 /// Put item into the queue. If optional args block is true and timeout is None (the default), block if necessary
@@ -34,6 +34,10 @@ type Queue<'T>() =
3434 /// operation goes into an uninterruptible wait on an underlying lock. This means that no exceptions can occur, and
3535 /// in particular a SIGINT will not trigger a KeyboardInterrupt.
3636 member x.get (? block : bool , ? timeout : float ) : 'T = nativeOnly
37+ /// Equivalent to get(False).
38+ /// See https://docs.python.org/3/library/queue.html#queue.Queue.get_nowait
39+ [<Emit( " $0.get_nowait()" ) >]
40+ member x.get_nowait () : 'T = nativeOnly
3741 /// Blocks until all items in the queue have been gotten and processed.
3842 ///
3943 /// The count of unfinished tasks goes up whenever an item is added to the queue. The count goes down whenever a
@@ -57,24 +61,31 @@ type LifoQueue<'T>() =
5761
5862[<Import( " SimpleQueue" , " queue" ) >]
5963type SimpleQueue < 'T >() =
60- /// Return the approximate size of the queue. Note, qsize() > 0 doesn’ t guarantee that a subsequent get() will not
64+ /// Return the approximate size of the queue. Note, qsize() > 0 doesn' t guarantee that a subsequent get() will not
6165 /// block, nor will qsize() < maxsize guarantee that put() will not block.
6266 member x.qsize () : int = nativeOnly
63- /// Return True if the queue is empty, False otherwise. If empty() returns True it doesn’ t guarantee that a
64- /// subsequent call to put() will not block. Similarly, if empty() returns False it doesn’ t guarantee that a
67+ /// Return True if the queue is empty, False otherwise. If empty() returns True it doesn' t guarantee that a
68+ /// subsequent call to put() will not block. Similarly, if empty() returns False it doesn' t guarantee that a
6569 /// subsequent call to get() will not block.
6670 member x.empty () : bool = nativeOnly
67- /// Return True if the queue is full, False otherwise. If full() returns True it doesn’ t guarantee that a subsequent
68- /// call to get() will not block. Similarly, if full() returns False it doesn’ t guarantee that a subsequent call to
71+ /// Return True if the queue is full, False otherwise. If full() returns True it doesn' t guarantee that a subsequent
72+ /// call to get() will not block. Similarly, if full() returns False it doesn' t guarantee that a subsequent call to
6973 /// put() will not block.
7074 member x.put ( item : 'T , ? block : bool , ? timeout : float ) : unit = nativeOnly
71- /// Remove and return an item from the queue. If optional args block is true and timeout is None (the default),
72- /// block if necessary until an item is available. If timeout is a positive number, it blocks at most timeout
73- /// seconds and raises the Empty exception if no item was available within that time. Otherwise (block is false),
74- /// return an item if one is immediately available, else raise the Empty exception (timeout is ignored in that
75- /// case).
76- ///
77- /// Prior to 3.0 on POSIX systems, and for all versions on Windows, if block is true and timeout is None, this
78- /// operation goes into an uninterruptible wait on an underlying lock. This means that no exceptions can occur, and
79- /// in particular a SIGINT will not trigger a KeyboardInterrupt.
75+ /// Remove and return an item from the queue.
8076 member x.get (? block : bool , ? timeout : float ) : 'T = nativeOnly
77+ /// Equivalent to get(False).
78+ [<Emit( " $0.get_nowait()" ) >]
79+ member x.get_nowait () : 'T = nativeOnly
80+
81+ /// Exception raised when non-blocking get() is called on an empty Queue
82+ /// See https://docs.python.org/3/library/queue.html#queue.Empty
83+ [<Import( " Empty" , " queue" ) >]
84+ type Empty () =
85+ inherit exn()
86+
87+ /// Exception raised when non-blocking put() is called on a full Queue
88+ /// See https://docs.python.org/3/library/queue.html#queue.Full
89+ [<Import( " Full" , " queue" ) >]
90+ type Full () =
91+ inherit exn()
0 commit comments