Nirvana Flex : Publishing Events to a Channel

Once the session has been established with the Nirvana realm server, and the channel has been located, a new Nirvana Event object (nConsumeEvent) must be constructed prior to use in the publish call being made to the channel.

Note that in this example code, we also create a Nirvana Event Dictionary object (nEventProperties) for our Nirvana Event before publishing it:

var event : nConsumeEvent = new nConsumeEvent();
var dictionary : nEventProperties = new nEventProperties();
dictionary.put("exampleKey", "Hello World");
event.properties=dictionary;
channel.publish(evt);

The final item to note is that the publish call is asynchronous; it returns immediately, allowing single-threaded Flex clients to continue processing.

Share this page with others:
Tell Your Tweets Facebook It! Add to Delicious Reddit! Digg It! Stumble Upon Add to Your Faves Mixx it
Follow Us:
Keep up with my-Channels on Twitter Become a fan on Facebook LinkedIn Profile Recent Highlights RSS Feed