Module for sending messages through PubNub
If you are receiving the data you expect, I think you are 99% there. 

Alternatively, you could include the PubNub JS client into your Drupal app (vs. the PHP client), then you can publish asynchronously, or even completely after page load.

Link to the JS client and docs are available here, with a specific example of how to publish here