Universal Messaging 9.8 | Universal Messaging Developer Guide | Enterprise APIs | Enterprise Developer's Guide for Python | Enterprise Client Development | Synchronously Requesting Events
 
Synchronously Requesting Events
Although in most circumstances it is more efficient to consume events asynchronously. The Universal Messaging Python API also provides the ability to request events one by one from the server.
Once you have created a session you can create an iterator for the channel or queue that you wish to consume from.

iter = Universal MessagingModule.getIterator(channame,startEid, selector,
timeout)
for evt in iter:
doSomething(evt)
On each iteration the Python client will request an event from the server and receive the event back as a response. Once the client has consumed all of the events on the channel/queue, it will wait for timeout milliseconds for another event to be received. When the client times out it will stop iterating.
Alternatively you can manually request events from the server:

evt = iter.next()
Once all events are consumed the next() method will time out and return None.

Copyright © 2013-2015 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.