Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

Python queues



The behavior of python notification is specified by the pythonQueue element. This element is a child of the pythonImplementation and allows to specify how the services notifications are handled at the python level. This element has the following attributes (all optional):
  • queueSize: the optional size of the queue (used for all services notifications by default)
  • publishQueueSize: the optional size of the queue for publish Service notifications
  • eventQueueSize: the optional size of the queue for event and request services notifications. Note that the event queue has priority on the publish queue
These queues are used both for services notified to the Python module, but also for services called cyclically[1]
These services being publish services, they share the same queue as publish services notifications
.

There are two ways to define the queues:
  • Only define the queueSize: in that case, there is only one queue for all notifications, regardless of the service type
  • Define the publishQueueSize and eventQueueSize: in that case, there is one queue for the publish notifications, and another one for event and requests notifications
Note that if the pythonQueue elemen is not present, onyl one queue will be defined, with a default size of 10.

Queue size value

For each queue, it is possible to specify the size of the queue with the following values:
  • "blocking": equivalent to "1", specify a queue with only one element
  • "unlimited": equivalent to "10000"
  • any positive integer: the int size of the queue

Queue behavior

If a queue is not full, then the next notification will be added at the end of the queue.

If a queue is full, then all further notifications will be discarded for this queue until the queue has again available spaces.

Example

An example with one queue:
        <pythonImplementation path="pythonAppli" inputSize="1024" outputSize="1024">
            <pythonQueue queueSize="20" />
        </pythonImplementation>
An example with two queues:
        <pythonImplementation path="pythonAppli" inputSize="1024" outputSize="1024">
            <pythonQueue publishQueueSize="20" eventQueueSize="10" />
        </pythonImplementation>

Notes

  1. ^ These services being publish services, they share the same queue as publish services notifications

See also


Categories: concepts | python

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence