![]() ![]() If TIMEOUT is missing, undef, or less than or equal to 0, then this call behaves the same as dequeue_nb. Fractional seconds (e.g., 2.5 seconds) are also supported (to the extent of the underlying implementation). The timeout may be a number of seconds relative to the current time (e.g., 5 seconds from when the call is made), or may be an absolute timeout in epoch seconds the same as would be used with cond_timedwait(). If the timeout is reached, it returns whatever items there are on the queue, or undef if the queue is empty. If the queue contains fewer than the requested number of items, then the thread will be blocked until the requisite number of items are available, or until the timeout is reached. Removes the requested number of items (default is 1) from the head of the queue, and returns them. # ->dequeue_timed(TIMEOUT) # ->dequeue_timed(TIMEOUT, COUNT) If the queue is empty, then undef is returned. If the queue contains fewer than the requested number of items, then it immediately (i.e., non-blocking) returns whatever items there are on the queue. ![]() If the queue contains fewer than the requested number of items, then the thread will be blocked until the requisite number of items are available (i.e., until other threads enqueue more items). # ->enqueue(LIST)Īdds a list of items onto the end of the queue. The following methods deal with queues on a FIFO basis. # QUEUE CREATION # ->new()Ĭreates a new queue pre-populated with the provided list of items. See "LIMITATIONS" for caveats related to passing objects via queues. While (defined(my $item = $q->dequeue())) ) My $q = Thread::Queue->new() # A new empty queue This document describes Thread::Queue version 3.14 #SYNOPSIS use strict Thread::Queue - Thread-safe queues #VERSION ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |