| Article: |
How to Use JMS with PHP | |
| Subject: | phpmq | |
| Date: | 2004-11-02 09:41:18 | |
| From: | simbo | |
|
what happens in the example when the queue is empty?
|
||
Showing messages 1 through 1 of 1.
-
phpmq
2004-11-02 10:47:00 Amir Shevat |
[View]
|
|
||||||||||||||||||
Women in TechnologyHear us Roar
Showing messages 1 through 1 of 1.
|
||||||||||||||||||
|
||||||||||||||||||
The example assumes that the queue has elements in it ready to be dequeued, the
dequeuewill return null if empty. In the real world there should be a default value (i.e. "./myAdd.gif") set whendequeuereturns null.As for the second question - calling
subscribeadds a listener that gathers messages up to, but no more than $messagesToCash. Calling thegetMessageFromTopic($userKey, $topicName)returns all the messages gathered by that listener (empty array if non gathered).I found that using non blocking methods caused less problems when running the PHP scripts. Do you think there is a need for blocking methods in addition to the non blocking?