Shared event system, as I nicknamed this approach, is implemented as a shared set of in-memory tables, which are accessed and manipulated by producers and listeners. The important part is that there is no dedicated server: housekeeping is distributed between the producers and listeners.
- Shared Events, The Delphi Magazine 97, September 2003
Shared events mechanism was definitely the most complicated architecture based on shared memory I ever put together. The system allowed multiple programs (running on the same computer) to cooperate using an event-based system. First program would publish an event (or more events) and others would subscribe to those events. First program would then broadcast the event, which would trigger notifications in all subscribed programs. The best trick was that there was no privileged part – no server, service or manager. Publishers and consumers shared all the work – tables were created as needed, housekeeping was done on both sides and so on.
Underlying architecture was largely redesigned after this article was published. Original source files are included only for historical reference.
Links: article (PDF, 496 KB), source code (ZIP, 1,9 MB), current version.
Does your Shared events work within Delphi 2009?
ReplyDeleteAt the moment, it does not. I'll fix it.
ReplyDelete