[nycphp-talk] Being notified when something changes in the database
anoland
anoland at indigente.net
Fri Aug 20 20:23:29 EDT 2010
On 08/20/2010 04:27 PM, Matt Juszczak wrote:
>> I get the use of triggers but can you explain the queue concept?
>> Let's say I want to be notified every time the count of
>> an item is increased. How would a queue play into that?
>
> Have a trigger create a record in the event queue, and then have a
> process that runs to process the queue (could be a cron, or a daemon)
> and send out emails, etc.
>
> -Matt
Not to discount Matt's solution; it is a good one. But for the sake of
completeness: you could also use the observer pattern here.
Some articles about it.
http://devzone.zend.com/article/12229
http://www.phpro.org/tutorials/Design-Patterns.html#6
http://www.fluffycat.com/PHP-Design-Patterns/Observer/
More information about the talk
mailing list