OpenClovis Logo

Functional Description
Event Service

Description of the Event Management. More...

Description of the Event Management.

The OpenClovis Event Service is a communication mechanism based on the concept of event channels. It is a publish and/or subscribe mechanism where a publisher can communicate with one or more subscribers asynchronously by publishing events over an event channel. The publishers and subscribers can be any component residing anywhere in the cluster.

An Event has a standard header and zero or more bytes of publisher event data. Publishers and Subscribers can communicate over multiple event channels. Multiple publishers and multiple subscribers can communicate over a single event channel. Subscribers are anonymous, which means that they can join and leave an event channel at any time without involving the publisher(s). An Event publisher can also be an Event subscriber.

The Event Service function does not impose a specific layout or format for the published event data. Publishers and subscribers on an event channel must agree on the structure of the data for events published on that event channel. They can use data marshalling, if support for heterogeneity is required. Conventions on the structure of the event data can vary from one event channel to another.

Usage Model

A component can subscribe to receive events on an event channel using the clEventSubscribe() function. The Event Service delivers events to a subscribing component using the clEvtEventDeliverCallback() function of that component. To stop receiving events for which it has registered, a subscriber can invoke the clEventUnsubscribe() function. If a component terminates abnormally, the Event Service closes all of its open event channels.

Service Description

Events

An event consists of a standard set of event attributes (event header) and zero or more bytes of event data. An event header is allocated using the clEventAllocate() function and is released using the clEventFree() function. The clEventAllocate() function returns a handle that can be used in subsequent invocations of the Event Service functions. The event attributes are written and read using {{SET}} and {{GET}} functions of the Event Service function. These attributes cannot be read and written directly. An event is published using the clEventPublish() function. The parameters to be specified for this function are event handle, additional information (optional), and event data contained in a data buffer. Thus, a published event consists of the event header that contains the set of attributes and additional information (optional) contained in the data buffer.

Event Channels

An event channel enables multiple publishers to communicate with multiple subscribers. It is global to a cluster and is identified by a unique name. To use the Event Service, a component must open an event channel using the clEventChannelOpen() or clEventChannelOpenAsync() function. The event channel is created, if it does not exist. A component can open an event channel to publish events and subscribe to receive events. Publishers can also act as subscribers on the same event channel. Event channels can be deleted using the clEventChannelUnlink() function. When an event is allocated for an event channel using the clEventAllocate() call, it can be published several times on the same event channel, by changing its attributes prior to each publication.

The OpenClovis Event Channel has the following features:


Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen