poll
Retrieve data sent to a pollable data queue
Description
retrieves one item of data from the
data
= poll(pollablequeue
)parallel.pool.PollableDataQueue
specified by
pollablequeue
. You can send data from the client or any
worker but you must call poll
on the client or worker in which
you created the pollable data queue.
If data is in the queue,
poll
returns the oldest item of data in the queue.If no data is in the queue,
poll
returns[]
.
waits data
= poll(pollablequeue
,timeout
)timeout
seconds to retrieve data from the
PollableDataQueue
object pollablequeue
.
If data is in the queue,
poll
returns the oldest item of data in the queue.If no data is in the queue,
poll
waits up totimeout
seconds. If the queue receives data beforetimeout
seconds elapse,poll
returns that item. If no data is received in the queue beforetimeout
seconds elapse,poll
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
See Also
afterEach
| send
| parfor
| parpool
| parfeval
| parfevalOnAll
| DataQueue
| parallel.pool.PollableDataQueue