Event Dispatcher and Failed Posted Notifications
| From: | Michael Caplan | Date: | Wed, 26 Jan 2005 16:10:10 +0000 |
| Subject: | Event Dispatcher and Failed Posted Notifications | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17173@lists.php.net to get a copy of this message | ||
Bertrand et al,
I have been paying close attention to the proposed / approved Event
Dispatcher, as it seems to provide a very elegant solution to the problem of
inter-module coupling. I have spent some time in the code and working
through the unit tests to figure out how Event Dispatcher works. I think I
have my head around most of it, but there is one issue I can't seem to
figure out and I am hoping you or anyone else can help me solve it.
The scenario is this: I am coding in an environment which has several
defined modules. Each module provides unique functionality (eg: article
module, calendar module, tracker module, etc....). Under certain scenarios,
these modules will need to interface with each other (eg: an article is
posted into the article module which requires the tracker module to be
updated so that it can track access to the article - or something like
that). So, module A posts an event (which is to be handled immediately)
which the dispatcher then forwards to an observer in module B. All good.
But let's say the event posted to module B fails. For whatever reason,
module A has a strong dependency on module B doing it's work, and upon
failure of module B's handled event it would be most desirable that module A
rolls back. Is there a way that the event poster can become aware of an
event failure (presuming it is an immediately posted event)?
I've spent some time in the COCOA docs that you referenced and modeled your
work on, and don't see how such a scenario would be handled there either.
Perhaps the scenario that I am outlining is not viable real world example?
Thanks for your time and excellent work,
Michael Caplan
CONFIDENTIALITY NOTICE
This message contains confidential information intended only for the use of
the individual or entity named as recipient. Any dissemination, distribution
or copying of this communication by anyone other than the intended recipient
is strictly prohibited. If you have received this message in error, please
immediately notify us and delete your copy. Thank you.
AVIS DE CONFIDENTIALITÉ
Les informations contenues aux présentes sont de nature privilégiée et
confidentielle. Elles ne peuvent être utilisées que par la personne ou
l'entité dont le nom paraît comme destinataire. Si le lecteur du présent
message n'est pas le destinataire prévu, il est par les présentes prié de
noter qu'il est strictement interdit de divulguer, de distribuer ou de
copier ce message. Si ce message vous a été transmis par mégarde, veuillez
nous en aviser immédiatement et supprimer votre copie. Merci.