poll
Retrieve data sent to pollable data queue
Description
retrieves one item of data from the data = poll(pollablequeue)parallel.pool.PollableDataQueue
object specified by pollablequeue.
If data is in the queue,
pollreturns the oldest item of data in the queue, even if the queue is closed.If no data is in the queue,
pollreturns[].If the queue is closed and no data is in the queue,
pollreturns[].
waits data = poll(pollablequeue,timeout)timeout seconds to retrieve data from the
PollableDataQueue object pollablequeue.
If data is in the queue,
pollreturns the oldest item of data in the queue, even if the queue is closed.If no data is in the queue,
pollwaits up totimeoutseconds. If the queue receives data beforetimeoutseconds elapse,pollreturns that item. If no data is received in the queue beforetimeoutseconds elapse,pollreturns[].If the queue is closed or is closed during timeout and no data is in the queue,
polldoes not wait and returns[].
[ tries to retrieve data,tf]
= poll(___)data from the queue. If
poll returns data, tf is true.
You can use this syntax with any of the input argument combinations in the
previous syntaxes. For example, [data,tf] = poll(pollablequeue,5)
waits to retrieve data from the queue pollablequeue for five
seconds.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2017a