Women in Technology

Hear us Roar



Article:
  How to Use JMS with PHP
Subject:   phpmq
Date:   2004-11-02 10:47:00
From:   ashevat
Response to: phpmq

In general all PHPMQ messaging methods are non blocking.

The example assumes that the queue has elements in it ready to be dequeued, the dequeue will return null if empty. In the real world there should be a default value (i.e. "./myAdd.gif") set when dequeue returns null.

As for the second question - calling subscribe adds a listener that gathers messages up to, but no more than $messagesToCash. Calling the getMessageFromTopic($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?