Basic Case, Publication C
Proxy Initialization
Notification
Content publication
Basic Case, Publication code C
 |
 |
Notification
the basic message unit
Published content takes the form of a notification; each publishing event is captured as a notification.
For this sample, the notification contains the contents of channel 7's predefined attribute Message; the data type of the attribute is string. The string contains the content of the notification.
Each notification must access the proxy so that the proxy can validate the notification against the channel's data type for the attribute. The publisher's proxy creates the notification for a particular subject.
PC_evn_create_notification(notification, proxy,"subject",closure);
The notification must define its content. In this case, we define our content by setting a value for a predefined attribute:
PC_evn_set_predefined_attr_by_name(notification, "Attribute","attribute value", data type,closure));
Here's the code to create a notification for channel 7's subscribers:
PC_evn_create_notification(&n, p,"Sample.Intro1",NULL);
PC_evn_set_predefined_attr_by_name(n, "Message","Hello World", PC_STRING_TYPE,strlen("Hello World"));
|