Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client Java API Programmer's Guide | Subscribing to and Receiving Events | Getting Events using the poll Method
 
Getting Events using the poll Method
 
The BrokerClientPoll Object
Key Methods used in the Polling Model
Using the poll Method
You can use the BrokerClient.poll method to simultaneously poll the queues of multiple Broker clients with a single thread. Unlike the "get events" model, where clients check their queues in serial fashion and block for a specified interval if their queue is empty, the poll method enables an application to dispatch a client to its queue only if there are events there for it to retrieve. This approach results in a more efficient process that wastes fewer cycles on non-productive work (i.e., blocking while a client attempts to retrieve events from an empty queue).
Because the poll method uses a single thread to monitor the queues of multiple clients, it is also easier to implement than spawning individual threads for each client.