Add AQueue Service To APage
Access
{{reader}}
Favourite Pages
{{pageEntry.pageName}}
Signed in as {{currentUser}} {{avatar}}
Sign Out
Sign In as Different User
{{currentUserExtraOptions}}
OpenForumDocumentation
CookBook
AddAQueueServiceToAPage
Edit page.js
Add the message queue javascript library
OpenForum.loadScript("/OpenForum/MessageQueue/MessageQueue.js");
Set up queue polling
var queueName = "my-queue-name"; var queue; OpenForum.init = function() { queue = new MessageQueue(queueName); timer = setInterval( queue.pull , 1000 ); };
Create a queue processor
var queueName = "my-queue-name"; var queue; OpenForum.init = function() { queue = new MessageQueue(queueName); queue.processMessages = function(messages) { for(var i=0; i< messages.length; i++) { processMessage(messages[i]); } }; timer = setInterval( queue.pull , 1000 ); }; functioon processMessage(message) { //do something with the message }
An error has occurred.
{{OpenForum.errorMessage}}
See technical details
×
Error details.
{{OpenForum.error}}
×
{{OpenForum.alert.title}}
{{OpenForum.alert.message}}
×