Whitebeam Template Reference Documentation

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Whitebeam Template Reference Documentation

System Template

sleep()

Put this instance of the Presentation Engine to sleep for a period

Syntax

void = rb.page.sleep(period)

Parameters

The 'sleep' method takes 1 parameter:

Name Type/Value Range/Length Description
periodnumber  Required. Number of seconds to sleep.

Results

The 'sleep' method returns no useful information.

Remarks

A call to this method will cause the presentation engine to suspend operation for a defined number of seconds.

Generally this is not useful behaviour for a web server and definitely is to be avoided whenever possible because it ties up resource on the server. It can however be useful in certain critical operations, or in administrative functions.

One example might be attempting to update a critical resource that's currently in use. Rather than generate an error a pause and retry could be more appropriate.

Another example might be a background email job where we wish to pause after the distribution of each block of emails in order to spread out the load on the server.

Think very carefully before using this method. Putting an Apache/Whitebeam process to sleep for a period ties up the system resources used by that process. This can cause Apache to have to start additional server processes, which in an already heavily loaded system can adverselt impact performance of the entire server..

Whitebeam release 1.3.36
(loadtime : 70ms)