new module:ct-element /buffer /Display Buffer()
The DisplayBuffer
class manages a 'throttle thread' that wakes up at regular intervals and refreshes
buffered controls that have registered a request to refresh and/or flash. In this way, DisplayBuffer
is used to restrict the update of a buffered control (one that implements module:ct-element/buffer/Buffered
)
to at most one update in the interval at it operates. The DisplayBuffer manages a scheduled thread that manages
buffered controls.
Methods
cancel(renderer)
Cancels any pending refreshes or flashes to the renderer and its control.
Parameters:
Name | Type | Description |
---|---|---|
renderer |
module:ct-element |
The control to be cancelled. |
finalize()
Releases all resources by clearing all queues and stopping the throttle thread.
is Live() → {Boolean}
Returns true if the DisplayBuffer
has a currently active update scheduler thread.
Returns:
TRUE if update thread is currently running.
- Type
- Boolean
is Queue Empty() → {boolean}
Returns true if there are no renderers waiting for notification to write their updates.
Returns:
TRUE if no renderers are queued waiting for update write notification.
- Type
- boolean
refresh()
Refreshes all pending controls in the queue and removes any stale flashes.
remove All Flashes()
Resets the flash effect from all controls immediately, rather than waiting for them to go stale.
request Refresh(renderer)
Registers a request to update the specified control.
Parameters:
Name | Type | Description |
---|---|---|
renderer |
module:ct-element |
The control to be refreshed. |
request Remove Flash(control)
Registers a request to remove the flash of the specified control. The flash will be reset upon the next
DisplayBuffer
refresh.
Parameters:
Name | Type | Description |
---|---|---|
control |
module:ct-element |
The control that is to have its flash removed. |
start()
Starts the throttle thread to run at the specified interval.
stop()
Stops the throttle thread.
to String() → {String}
Returns a human-readable string representation of the object, which is useful for debugging.
Returns:
The string representation
- Type
- String