Example: Interactive Visualforce Page without Replay
The interactive Visualforce example shows you how to implement Streaming API from a Visualforce page. The sample uses the Dojo library and CometD to subscribe to PushTopic events.
On the Visualforce page, you enter the name of the PushTopic channel you want to subscribe to and click Subscribe to receive notifications on the page. Click Unsubscribe to unsubscribe from the channel and stop receiving notifications.
This sample doesn’t use the replay extension and can’t receive past events.
Use the Developer Console to create the PushTopic record that contains a SOQL query. Event notifications are generated for updates that match the query.