Overview

The notification channel APIs provide developers with an easy-to-use, high-performance, event-driven system in C++, Java, and Python. The API is based on a push event channel model where event suppliers push events onto the channel and event consumers process these asynchronously. It is also a many-to-many publishing model whereby multiple suppliers send events to multiple consumers on the same channel. There are only two classes developers need to be concerned with: SimpleSupplier and SimpleConsumer. SimpleSupplier was designed so that events could be published in the simplest manner possible without exposing any CORBA to the developer. Essentially all that needs to be known is the channel’s name and the IDL structure being published. With the SimpleConsumer class, the developer is responsible for providing the channel’s name as well as associating event types with functions that will handle them.

High-level Guide

  1. Determine whether or not the ACS event channel API is suitable for your needs:
    • Will more than one piece of code be interested in the data being sent? If not, considering using Callbacks.
    • Is the data being sent very large? If so, considering using Bulk Data Transfer.
    • Is the data being sent on a very low frequency? If so, considering using normal CORBA client invocations.
  2. Define a struct in IDL to serve as your event. The name of this struct should have "Event" appended to it.
  3. Determine the pre-existing channel (defined by a string) your event should be published on or come up with a new channel name defined as const string in IDL with "CHANNEL" appeneded to it.
  4. To publish an event, instantiate an ACS Supplier or Supplier-derived object and utilize the Supplier's publishEvent method. Details on doing this can be found here.
  5. To subscribe to an event, instantiate an ACS Consumer or Consumer-derived object and utilize the Consumer's addSubscription method. addSubscription requires the developer to provide the event type and also a function or method capable of consuming that particular type of event. Details on doing this can be found here.

Special Notes

Examples in the ALMA CVS Repository

ACS/LGPL/CommonSoftware/acsexmpl/ws/include/acsexmplFridgeImpl.h (C++ Supplier)
ACS/LGPL/CommonSoftware/acsexmpl/ws/src/acsexmplFridgeImpl.cpp (C++ Supplier)
ACS/LGPL/CommonSoftware/acsexmpl/ws/src/acsexmplClientFridgeNC.cpp (C++ Consumer)
ACS/LGPL/CommonSoftware/jcontexmpl/src/alma/demo/EventSupplierImpl/ (Java Supplier)
ACS/LGPL/CommonSoftware/jcontexmpl/src/alma/demo/EventConsumerImpl/ (Java Consumer)
ACS/LGPL/CommonSoftware/acspyexmpl/src/acspyexmplFridgeNCSupplier.py (Python Supplier)
ACS/LGPL/CommonSoftware/acspyexmpl/src/acspyexmplFridgeNCConsumer.py (Python Consumer)

Related Documents

ACS Notification Channel Design and Tutorial
Associated inline documentation for the C++, Java, and Python APIs
Callbacks
Event Browser


Keywords: Notification Service, Supplier, Consumer, Event, Channel, IDL, C++, Java, Python