5.3.4. Cogent DataHub instance Point Events (Exception Handlers)

The Cogent DataHub program is a data collection and distribution center designed for easy integration with the Gamma language. A point is a name for data in a DataHub instance. An exception handler is a Gamma expression that is attached to a point. The DataHub instance can asynchronously transmit any number of point values to a Gamma program, which will then automatically update the value of a symbol named the same as the DataHub point.

The add_exception_function and add_echo_function functions permit an application to bind an expression to a DataHub point exception in a similar way to add_set_function above. If an application can both write a point and receive exceptions from that point, then the DataHub instance will "echo" the exception originated by the application. The two functions make it possible to distinguish between these two situations. Only the originating task will see a point exception as an echo, while all other tasks will see a normal exception.

In addition, the programmer may attach any number of expressions to the symbol, to be evaluated when the DataHub point changes. The expressions are evaluated within a sub-scope, with the special symbols: value, previous and this defined to be: the current value of the point, the previous value of the point and the point name itself as a symbol. An exception handler is only triggered during a call to next_event, next_event_nb or flush_events.