Am trying to understand better the function of the timeout, help says:
timeout in ms specifies the time, in milliseconds, that the function waits for available space in the queue if the queue is full. The default is –1, indicating never to time out.
--> I do not understand what it says by waits for available space? Why does it wait for that space? Which available space? And what happens if the timeout is reached? What is the usage of this timeout?
Very grateful for responses!
Solved! Go to Solution.
When you create (obtain) a queue you can choose to give the queue a finite size.
If you have a finite size and you have filled it, trying to add more elements simply cannot work.
The code will hang here for the amount of time specified in the timeout. If a space becomes available in this timeframe, the element is added to the queue and code continues as normal.
If no space become savailable by the time the timeout expires, the code will continue, but the "timed out" output will be set to TRUE.