poll
Retrieve data from PollableDataQueue
Description
retrieves
one item of data from the data
= poll(q
)PollableDataQueue
object q
.
Send data from the background or your current MATLAB® session using send
.
You can retrieve data sent from a function that you run on a parallel pool if you have
Parallel Computing Toolbox™. For details, see poll
(Parallel Computing Toolbox).
If no data is in the queue,
poll
returns[]
.If data is in the queue,
poll
returns the oldest item of data in the queue.
waits data
= poll(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,
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 from a queue and returns a flag
data
,tf
]
= poll(___)tf
. If poll
returns 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)
waits to retrieve data from
the queue q
for five seconds.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2017a
See Also
afterEach
| send
| parfor
| parallel.pool.DataQueue
| parallel.pool.PollableDataQueue