poll
Retrieve data from PollableDataQueue
Description
data
=
poll(
waits
q
,timeout
)timeout
seconds to retrieve an item of data from the
PollableDataQueue
object q
.
If data is in the queue,
poll
returns the oldest item of data in the queue.If no data is in the queue, waits up to MATLAB® for
timeout
seconds. If data is received in the queue beforetimeout
seconds elapse,poll
returns that item. If no data is received in the queue beforetimeout
seconds elapse,poll
returns[]
.
[
tries to retrieve data from a queue and returns a flag data
,tf
]
= poll(___,timeout
)tf
. If
poll
was able to return data, tf
is
true
. Otherwise, tf
is
false
.
You can use this syntax with any of the input argument combinations in the previous
syntaxes. For example, [data,tf] = poll(q,5)
tries to retrieve data from
the queue q
for five seconds.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2017a
See Also
afterEach
| send
| parfor
| parallel.pool.DataQueue
| parallel.pool.PollableDataQueue