Lasso Soft Inc. > Home

[ Event_Schedule ]

Method

[Event_Schedule] schedules a URL to be loaded by Lasso at a specified time in the future or schedules repeated loads of a specified URL.

This method can be used to execute format files on the local server or to trigger CGIs on remote servers. It can schedule a URL to be loaded immediately or at a specific time in the future. Additionally, it can schedule repeated loads of a URL until a designated end time.

The queue of scheduled events can be viewed and individual events can be modified or deleted in the Scheduler LassoApp*.

If a -Start parameter is specified then the first load of the URL will be within a minute of the date and time specified. If no -Start parameter is specified, then the first load of the URL will be within a minute of the tag execution.

If a -Delay parameter is specified then the URL will be loaded and requeued for the specified number of minutes in the future. If no -Delay is specified then the URL will be loaded only once. The URL will continue to be requeued until thedate and time specified in the -End parameter is reached. If no -End parameter is specified then the URL will continue to load indefinitely.

If a -Restart=False parameter is specified then the URL will not be requeued after Lasso Service is restarted. By default, all scheduled URLs will be executed as soon as possible after Lasso Service is restarted.

The optional -Username and -Password parameters specify the username and password that should be used to authenticate the URL load. If specified they will be sent to the specified server in the same format that Web browsers send authentication information to Web servers.

GET parameters can be specified directly within the -URL parameter. If POST parameters or additional MIME headers are required then a format file on the local server which contains an [Include_URL] tag should be scheduled for execution.

Similarly, emails can be sent or periodic server maintenance tasks can be performed by scheduling loads of format files on the local server that perform those tasks. Use of a unique username and password can ensure that these pages will not be loaded by site visitors.

Note: Lasso only guarantees the accuracy of scheduled URL executions within about a minute of the scheduled time. If Lasso Service is shut down, Lasso will execute any events that were supposed to be executed when Lasso Service is restarted. Repeating events will be rescheduled, but any missed repetitions will not be made up.

Required Parameters

-URL The URL of the page which should be executed at the time set by the other keyword/value parameters.

Optional Parameters

-Start The date and time at which to execute the event. By default set to the current date and time.

-End The date and time to stop executing a repeating event.

-Delay The number of minutes to delay between repetitions of a repeating event.

-Restart If set to true then the event will be rescheduled after the server restarts. If not set then the event will not be rescheduled. Defaults to False.

-Username An optional username which will be used to authenticate the execution of the scheduled event.

-Password An optional password which will be used to authenticate execution of the scheduled event.

*Installation Note

Lasso Scheduler is not included as part of the standard Lasso Server distribution and must be added manually. It is intrended for use with Lasso Server 9.2 only, and not for any subsequent versions.

See http://www.lassosoft.com/Lasso-9-2-Scheduler for download links and user interface documentation.

  • Syntax
Event_Schedule(-URL=URL)
Event_Schedule(-URL=URL, -Start=Start Time)
Event_Schedule(-URL=URL, -Delay=Minutes)
Event_Schedule(-URL=URL, -Delay=Minutes, -Restart=False)
Event_Schedule(-URL=URL, -Start=Start Time, -Delay=Minutes)
Event_Schedule(-URL=URL, -Start=Start Time, -End=End Time, -Delay=Minutes)
Event_Schedule(-URL=URL, -Start=Start Time,  -Delay=Minutes, -Restart=False)
Examples
  • Beginner

To schedule a page load:

Use the [Event_Schedule] method. The following method adds a page load for a page named PeriodicCleanup.Lasso on the server www.example.com. The page will be loaded every four hours so that periodic server maintenance tasks can be performed.

Code

Event_Schedule( 
  -URL='http://www.example.com/PeriodicCleanup.lasso',
  -Delay=240,
  -Restart=True)

To schedule an event to execute immediately:

Use the [Event_Schedule] method with only a -URL parameter. The event will execute within about a minute of when it is scheduled. This allows a task specified in a separate Lasso page to be executed separately from the main flow of the current Lasso page.

Code

Event_Schedule(-URL='http://www.example.com/event.lasso')

To schedule an event to happen at a specific time:

Use the [Event_Schedule] method with a -URL parameter and a -Start parameter. The event will execute within about a minute of the -Start time.

The following event is scheduled to execute at 4:00 PM on April 5, 2005. The date/time is specified in Lasso date format. -Restart is set to True to ensure this event is not deleted when the server is next restarted.

Code

Event_Schedule(
    -URL='http://www.example.com/event.lasso', 
    -Start='4/5/2005 16:00:00',
    -Restart=True
)

To schedule an event with a complex schedule:

Events which need to execute on a complex schedule must be rescheduled every time they are executed. If an event is being rescheduled explicitly then the -Delay parameter should not be specified.

For example, the following code included in the http://www.example.com/event.lasso Lasso page will reschedule the same Lasso page as an event depending on whether or not the condition in the [If] ... [/If] tags is True. If the condition is True then the event will be rescheduled for fifteen minutes in the future, otherwise the event will be rescheduled for two hours in the future.

Code

if(#reschedule == true) => {
    Event_Schedule(
        -URL='http://www.example.com/event.lasso', 
        -Start=(date_add(date), -Minute=15), 
        -Restart=False
    )
else
    Event_Schedule(
        -URL='http://www.example.com/event.lasso', 
        -Start=(date_add(date), -Hour=2), 
        -Restart=False
    )
}

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft