Module: alfresco/core/PubQueue

alfresco/core/PubQueue

Singleton providing class for handling publications. This allows publications to be queued whilst all the widgets on the page are created. The overall page widget will then "release" all the publications once the widgets are ready to process them.
Author:
  • Dave Draper
License:
Source:

Members

_pageCount :number

It is possible for multiple Surf Components to exist on a browser page where each Surf Component is creating a new Aikau page. In order for the PubQueue to only allow the release of publications once all pages have finished being created it is necessary to track the number of pages being rendered. This counter is incremented with every call to registerPage and decremented with every call to release. See AKU-965 for more information.
Type:
  • number
Since:
  • 1.0.68
Default Value:
  • 0
Source:

_queue :array

Type:
  • array
Default Value:
  • []
Source:

_released :boolean

Indicates whether or not the publications have been released. This is set from false to true when the release function is called and will result in publications no longer being queue but being published immediated
Type:
  • boolean
Default Value:
  • false
Source:

_unreleasedEmptied :boolean

To make sure that all publications are made in order after releasing, this flag is used to indicate that all queued publications have been made before publishing resulting publications. An example of this would be where a queued publication triggers another publication - it is imperative that this resulting publication does not "jump the queue". Instead it should itself be queued and wait for its turn.
Type:
  • boolean
Since:
  • 1.0.65
Default Value:
  • false
Source:

Methods

publish(scopedTopic, payload)

Parameters:
Name Type Description
scopedTopic string The topic to publish on
payload string The payload to be delivered
Source:

registerPage()

This function should only be called from the Page widget before the page is constructed. It increments the _pageCount counter to ensure that all pages finish rendering before publications are released.
Since:
  • 1.0.68
Source:

release()

Iterates over the queued publications and publishes them.
Source:

<inner> log(scopedTopic, payload, caller)

Logs the publication if the publication to be logged isn't a log request or a request to log publications or subscriptions.
Parameters:
Name Type Description
scopedTopic string The topic to publish on
payload object The payload to be delivered
caller object The widget or service requesting the publication
Source: