Skip to content
Chris Petersen edited this page Oct 16, 2014 · 1 revision

scheduler-init initializes all instances. It is to be placed in the application's initialization function declaration.

Parameter Description
timefunc Timefunction to be used.

Example

Example 1: Initialize a trendoutput plugin to save the store values of variables "HR" "SP" and "SQI" into the Trends file. This example assumes that the trendoutput plugin is included in the application's PLUGINS file.

(set! store (make-store "store"))
(scheduler-startcase store (time->timestamp (current-time)))
(make-instance store "TRENDOUT" "trendoutput" '("Trends" ("HR" "SP" "SQI")))
(scheduler-init)

Example 2: Initialization of scheduler with a custom time function. Here, an example from an application, which parses PCAP dump files for offline analysis and uses the packages timestamp as the time increment instead of the system time increment. Once it finds its first valid package it initializes a case and data parsing commences.

(scheduler-init (lambda () (store-ref location "timestamp" 0)))
(let loop ()
  (if (not (store-ref location "timestamp" #f)) 
   (begin (runtime-iterate) (loop)))
)
(scheduler-startcase location caseid)
Clone this wiki locally