create_message_queue — Create a new empty message queue.
create_message_queue( : : : QueueHandle)
create_message_queue creates a new empty message queue. The output parameter QueueHandle is a handle to the newly created message queue and is used to identify the queue in any subsequent operator calls using the queue.
The message queues are designed as FIFO pipes delivering arbitrary sets of data safely among different threads. The queue access is internally fully synchronized, no explicit locking is required from the application. The data is traveling through the queue in so called messages (see create_message).
Multiple producer threads can append data simultaneously (enqueue_message) while multiple consumer threads are simultaneously retrieving the data again (dequeue_message). Multiple messages can be enqueued together using a single enqueue_message operation. In such case, those messages will travel together through the queue and will be delivered through a single dequeue_message call.
Any messages sent to the queue are deeply copied (including the tuples and objects stored in the messages) by the enqueue_message operation. The original message(s) can thus be immediately reused after the enqueue_message call without affecting the enqueued copy.
When the message queue is no more needed, all associated resources, in particular the yet enqueued messages with all data they carry, should be released using clear_message_queue. Depending on the context, releasing any threads waiting for the queue data and flushing the queue contents might be required using set_message_queue_param before clearing the queue.
Handle of the newly created message queue.
Number of elements: QueueHandle == 1
Assertion: QueueHandle != 0
create_message_queue (ProducerQueue) create_message_queue (ResultQueue) * ... clear_message_queue ([ProducerQueue,ResultQueue])
Returns 2 (H_MSG_TRUE) unless a resource allocation error occurs. Otherwise an exception is raised.
clear_message_queue, enqueue_message, dequeue_message, set_message_queue_param, get_message_queue_param, create_message, clear_message, set_message_tuple, get_message_tuple, set_message_obj, get_message_obj