Commit 127a2d41 authored by Bas Lijnse's avatar Bas Lijnse

Centralized itasks engine options in an EngineOptions record that you can...

Centralized itasks engine options in an EngineOptions record that you can customize using startEngineWithOptions
parent 89dd8f56
......@@ -5,7 +5,7 @@ definition module iTasks
*/
import
// iTasks engine
iTasks.Internal.Engine
iTasks.Engine
// iTasks API
, iTasks.SDS.Definition
, iTasks.SDS.Sources.Core
......
definition module iTasks.Internal.Engine
definition module iTasks.Engine
/**
* This module provides the iTasks engine.
* This is the primary function that creates the complete
......@@ -6,37 +6,26 @@ definition module iTasks.Internal.Engine
*/
from StdList import ++, iterate, take
from System.FilePath import </>
from Data.Maybe import :: Maybe
from System.FilePath import :: FilePath
from System.OS import IF_POSIX_OR_WINDOWS
import iTasks.Internal.Task
from Internet.HTTP import :: HTTPRequest
from Internet.HTTP import :: HTTPRequest
import iTasks.WF.Definition
//* Configuration defaults
DEFAULT_PORT :== IF_POSIX_OR_WINDOWS 8080 80
DEFAULT_KEEPALIVE_TIME :== 300 // 5 minutes
SESSION_TIMEOUT :== 600 //Seconds (10 minutes)
MAX_EVENTS :== 5
:: PublishedTask =
{ url :: String
, task :: WebTaskWrapper
}
:: ServerOptions =
:: EngineOptions =
{ appName :: String
, appPath :: FilePath
, appPath :: FilePath // Location of the application's executable
, appVersion :: String
, serverPort :: Int
, keepalive :: Int
, serverUrl :: String
, keepaliveTime :: Int
, sessionTime :: Int
, persistTasks :: Bool
, webDirPath :: Maybe FilePath
, storeDirPath :: Maybe FilePath
, saplDirPath :: Maybe FilePath
, webDirPath :: FilePath // Location of public files that are served by the iTask webserver
, storeDirPath :: FilePath // Location of the application's persistent data files
, tempDirPath :: FilePath // Location for temporary files used in tasks
, saplDirPath :: FilePath // Location of the application's sapl files (client-side code)
}
:: WebTaskWrapper = E.a: WebTaskWrapper (HTTPRequest -> Task a) & iTask a
:: TaskWrapper = E.a: TaskWrapper (Task a) & iTask a
/**
* Starts the task engine with a list of published task definitions.
......@@ -51,11 +40,51 @@ startEngine :: a !*World -> *World | Publishable a
* Starts the task engine with options and a list of published task definitions.
*
* @param Tasks to start
* @param Options to use like port and server paths.
* @param An initialization function to set the engine options with:
@param The command line arguments
@param The default options
@return Maybe the engine options, in case of Nothing, the engine is not started
@return A message that is printed to the console when the engine is started
* @param The world
* @return The world
*/
startEngineWithOptions :: a ServerOptions !*World -> *World | Publishable a
startEngineWithOptions :: ([String] EngineOptions -> (!Maybe EngineOptions,![String])) a !*World -> *World | Publishable a
/**
* The function that takes the 'standard' command line options of an itask engine and
* shows the default help and startup message
*
* Essentially: startEngine = startEngineWithOptions defaultEngineCLIOptions
* @param The command line arguments
* @param The default options
* @return Maybe the engine options, in case of Nothing, the engine is not started
* @return A message that is printed to the console when the engine is started
*/
defaultEngineCLIOptions :: [String] EngineOptions -> (!Maybe EngineOptions,![String])
/**
* Determines the default options for an application
*/
defaultEngineOptions :: !*World -> (!EngineOptions,!*World)
/**
* Start a stripped task engine (without an HTTP server) with a list of tasks to be created
*/
runTasks :: a !*World -> *World | Runnable a
runTasksWithOptions :: ([String] EngineOptions -> (!Maybe EngineOptions,![String])) a !*World -> *World | Runnable a
// === Wrapping interactive tasks for use with the builtin iTask webserver ===
:: PublishedTask =
{ url :: String
, task :: WebTaskWrapper
}
:: WebTaskWrapper = E.a: WebTaskWrapper (HTTPRequest -> Task a) & iTask a
:: TaskWrapper = E.a: TaskWrapper (Task a) & iTask a
/**
* Wraps a task together with a url to make it publishable by the engine
......@@ -76,20 +105,11 @@ instance Publishable (Task a) | iTask a
instance Publishable (HTTPRequest -> Task a) | iTask a
instance Publishable [PublishedTask]
determineAppName :: !*World -> (!String,!*World)
// === Wrapping non-interactive tasks for running on the command line ===
/**
* Start a stripped task engine (without an HTTP server) with a list of tasks to be created
*/
class Runnable a
where
toRunnable :: !a -> [TaskWrapper]
instance Runnable (Task a) | iTask a
instance Runnable [TaskWrapper]
runTasks :: a !*World -> *World | Runnable a
//HACK FOR RUNNING BACKGROUND TASKS ON A CLIENT
background :: !*IWorld -> *IWorld
implementation module iTasks.Internal.Engine
implementation module iTasks.Engine
import StdMisc, StdArray, StdList, StdOrdList, StdTuple, StdChar, StdFile, StdBool, StdEnum
from StdFunc import o, seqList, ::St, const
from StdFunc import o, seqList, ::St, const, id
from Data.Map import :: Map
from Data.Queue import :: Queue(..)
import qualified Data.Map as DM
......@@ -19,7 +19,7 @@ import StdInt, StdChar, StdString
import tcp
import Internet.HTTP, System.Time, System.CommandLine, Data.Func
import iTasks.Internal.Engine, iTasks.Internal.IWorld, iTasks.Internal.TaskEval, iTasks.Internal.TaskStore
import iTasks.Internal.IWorld, iTasks.Internal.TaskEval, iTasks.Internal.TaskStore
import iTasks.Internal.Util
import iTasks.Internal.TaskServer
from iTasks.Extensions.DateTime import toDate, toTime, instance == Date, instance == Time
......@@ -29,39 +29,55 @@ from Sapl.Linker.LazyLinker import generateLoaderState, :: LoaderStateExt
from Sapl.Linker.SaplLinkerShared import :: SkipSet
from Sapl.Target.Flavour import :: Flavour, toFlavour
show :: ![String] !*World -> *World
show lines world
# (console,world) = stdio world
# console = seqSt (\s c -> fwrites (s +++ "\n") c) lines console
# (_,world) = fclose console world
= world
from System.OS import IF_POSIX_OR_WINDOWS
getServerOptions :: !*World -> (!Maybe ServerOptions,!*World)
getServerOptions world
# (opts,world) = getCommandLine world
# (appName,world) = determineAppName world
# (appPath,world) = determineAppPath world
//Check commandline options
# port = fromMaybe DEFAULT_PORT (intOpt "-port" opts)
# keepalive = fromMaybe DEFAULT_KEEPALIVE_TIME (intOpt "-keepalive" opts)
# help = boolOpt "-help" opts
# noPersist = boolOpt "-no-persist" opts
# webOpt = stringOpt "-webpublic" opts
# storeOpt = stringOpt "-store" opts
# saplOpt = stringOpt "-sapl" opts
//If -help option is given show help and stop
| help = (Nothing, show instructions world)
MAX_EVENTS :== 5
defaultEngineOptions :: !*World -> (!EngineOptions,!*World)
defaultEngineOptions world
# (appPath,world) = determineAppPath world
# (appVersion,world) = determineAppVersion appPath world
# appDir = takeDirectory appPath
# appName = (dropExtension o dropDirectory) appPath
# options =
{ appName = appName
, appPath = appPath
, serverPort = port
, keepalive = keepalive
, webDirPath = webOpt
, storeDirPath = storeOpt
, saplDirPath = saplOpt
, appVersion = appVersion
, serverPort = IF_POSIX_OR_WINDOWS 8080 80
, serverUrl = "http://localhost/"
, keepaliveTime = 300 // 5 minutes
, sessionTime = 600 // 10 minutes
, webDirPath = appDir </> appName +++ "-www"
, storeDirPath = appDir </> appName +++ "-data" </> "stores"
, tempDirPath = appDir </> appName +++ "-data" </> "tmp"
, saplDirPath = appDir </> appName +++ "-sapl"
, persistTasks = False
}
= (options,world)
defaultEngineCLIOptions :: [String] EngineOptions -> (!Maybe EngineOptions,![String])
defaultEngineCLIOptions cli defaults
//Check commandline options
# port = fromMaybe defaults.serverPort (intOpt "-port" cli)
# keepaliveTime = fromMaybe defaults.keepaliveTime (intOpt "-keepalive" cli)
# help = boolOpt "-help" cli
# noPersist = boolOpt "-no-persist" cli
# webOpt = stringOpt "-webpublic" cli
# storeOpt = stringOpt "-store" cli
# saplOpt = stringOpt "-sapl" cli
//If -help option is given show help and stop
| help = (Nothing, instructions)
# options =
{ defaults
& serverPort = port
, keepaliveTime = keepaliveTime
, webDirPath = fromMaybe defaults.webDirPath webOpt
, storeDirPath = fromMaybe defaults.storeDirPath storeOpt
, saplDirPath = fromMaybe defaults.saplDirPath saplOpt
, persistTasks = not noPersist
}
= (Just options,world)
= (Just options,running options.appName options.serverPort)
where
instructions :: [String]
instructions =
......@@ -70,11 +86,16 @@ where
," -webpublic <path> : Use <path> to point to the folder that contain the application's static web content"
," -store <path> : Use <path> as data store location"
," -sapl <path> : Use <path> to point to the folders that hold the sapl version of the application"
," -port <port> : Set port number (default " +++ toString DEFAULT_PORT +++ ")"
," -keepalive <time> : Set connection keepalive time in seconds (default " +++ toString DEFAULT_KEEPALIVE_TIME +++ ")"
," -port <port> : Set port number (default " +++ toString defaults.serverPort +++ ")"
," -keepalive <time> : Set connection keepalive time in seconds (default " +++ toString defaults.keepaliveTime +++ ")"
,""
]
running :: !String !Int -> [String]
running app port = ["*** " +++ app +++ " HTTP server ***"
,""
,"Running at http://localhost" +++ (if (port == 80) "/" (":" +++ toString port +++ "/"))]
boolOpt :: !String ![String] -> Bool
boolOpt key opts = isMember key opts
......@@ -95,27 +116,24 @@ where
= stringOpt key [v:r]
startEngine :: a !*World -> *World | Publishable a
startEngine publishable world
= case getServerOptions world of
(Nothing,world) = world
(Just options,world) = startEngineWithOptions publishable options world
startEngineWithOptions :: a ServerOptions !*World -> *World | Publishable a
startEngineWithOptions publishable options=:{appName,appPath,serverPort,keepalive,persistTasks,webDirPath,storeDirPath,saplDirPath} world
# world = show (running appName serverPort) world
# iworld = createIWorld appName appPath persistTasks webDirPath storeDirPath saplDirPath world
# (res,iworld) = initJSCompilerState iworld
| res =:(Error _) = show ["Fatal error: " +++ fromError res] (destroyIWorld iworld)
//Start task server
# iworld = serve [] tcpTasks systemTasks timeout iworld
= destroyIWorld iworld
startEngine publishable world = startEngineWithOptions defaultEngineCLIOptions publishable world
startEngineWithOptions :: ([String] EngineOptions -> (!Maybe EngineOptions,![String])) a !*World -> *World | Publishable a
startEngineWithOptions initFun publishable world
# (cli,world) = getCommandLine world
# (options,world) = defaultEngineOptions world
# (mbOptions,msg) = initFun cli options
# world = show msg world
= case mbOptions of
Nothing = world
Just options
# iworld = createIWorld (fromJust mbOptions) world
# (res,iworld) = initJSCompilerState iworld
| res =:(Error _) = show ["Fatal error: " +++ fromError res] (destroyIWorld iworld)
# iworld = serve [] (tcpTasks options.serverPort options.keepaliveTime) systemTasks timeout iworld
= destroyIWorld iworld
where
running :: !String !Int -> [String]
running app port = ["*** " +++ app +++ " HTTP server ***"
,""
,"Running at http://localhost" +++ (if (port == 80) "/" (":" +++ toString port +++ "/"))]
tcpTasks = [(serverPort,httpServer serverPort keepalive (engine publishable) allUIChanges)]
tcpTasks serverPort keepaliveTime = [(serverPort,httpServer serverPort keepaliveTime (engine publishable) allUIChanges)]
systemTasks =
[BackgroundTask updateClocks
,BackgroundTask (processEvents MAX_EVENTS)
......@@ -123,14 +141,16 @@ where
,BackgroundTask flushWritesWhenIdle]
runTasks :: a !*World -> *World | Runnable a
runTasks tasks world
= case getServerOptions world of
(Nothing,world) = world
(Just options,world) = runTasksWithOptions tasks options world
runTasksWithOptions :: a ServerOptions !*World -> *World | Runnable a
runTasksWithOptions runnable options=:{appName,appPath,serverPort,keepalive,persistTasks,webDirPath,storeDirPath,saplDirPath} world
# iworld = createIWorld appName appPath persistTasks webDirPath storeDirPath saplDirPath world
runTasks tasks world = runTasksWithOptions (\c o -> (Just o,[])) tasks world
runTasksWithOptions :: ([String] EngineOptions -> (!Maybe EngineOptions,![String])) a !*World -> *World | Runnable a
runTasksWithOptions initFun runnable world
# (cli,world) = getCommandLine world
# (options,world) = defaultEngineOptions world
# (mbOptions,msg) = initFun cli options
# world = show msg world
| mbOptions =: Nothing = world
# iworld = createIWorld (fromJust mbOptions) world
# (res,iworld) = initJSCompilerState iworld
| res =:(Error _) = show ["Fatal error: " +++ fromError res] (destroyIWorld iworld)
# iworld = serve (toRunnable runnable) [] systemTasks timeout iworld
......@@ -141,6 +161,13 @@ where
,BackgroundTask (processEvents MAX_EVENTS)
,BackgroundTask stopOnStable]
show :: ![String] !*World -> *World
show lines world
# (console,world) = stdio world
# console = seqSt (\s c -> fwrites (s +++ "\n") c) lines console
# (_,world) = fclose console world
= world
timeout :: !*IWorld -> (!Maybe Timeout,!*IWorld)
timeout iworld = case 'SDS'.read taskEvents iworld of //Check if there are events in the queue
(Ok (Queue [] []),iworld) = (Just 10,iworld) //Empty queue, don't waste CPU, but refresh
......@@ -173,7 +200,7 @@ updateClocks iworld=:{IWorld|clocks,world}
//When we run the built-in HTTP server we need to do active garbage collection of instances that were created for sessions
removeOutdatedSessions :: !*IWorld -> *(!MaybeError TaskException (), !*IWorld)
removeOutdatedSessions iworld
removeOutdatedSessions iworld=:{IWorld|options}
# (mbIndex,iworld) = read (sdsFocus {InstanceFilter|defaultValue & onlySession=Just True} filteredInstanceIndex) iworld
= case mbIndex of
Ok index = checkAll removeIfOutdated index iworld
......@@ -184,18 +211,18 @@ where
(Ok (),iworld) = checkAll f xs iworld
(Error e,iworld) = (Error e,iworld)
removeIfOutdated (instanceNo,_,_,_) iworld=:{clocks={timestamp},server={buildID}}
removeIfOutdated (instanceNo,_,_,_) iworld=:{options={appVersion},clocks={timestamp}}
# (remove,iworld) = case read (sdsFocus instanceNo taskInstanceIO) iworld of
//If there is I/O information, we check that age first
(Ok (Just (client,Timestamp tInstance)),iworld) //No IO for too long, clean up
= (Ok ((tNow - tInstance) > SESSION_TIMEOUT),iworld)
= (Ok ((tNow - tInstance) > options.EngineOptions.sessionTime),iworld)
//If there is no I/O information, get meta-data and check builtId and creation date
(Ok Nothing,iworld)
= case read (sdsFocus instanceNo taskInstanceConstants) iworld of
(Ok {InstanceConstants|build,issuedAt},iworld)
| build <> buildID = (Ok True,iworld)
| build <> appVersion = (Ok True,iworld)
# (Timestamp tInstance) = issuedAt
| (tNow - tInstance) > SESSION_TIMEOUT = (Ok True,iworld)
| (tNow - tInstance) > options.EngineOptions.sessionTime = (Ok True,iworld)
= (Ok False,iworld)
(Error e,iworld)
= (Error e,iworld)
......@@ -222,7 +249,6 @@ flushWritesWhenIdle iworld = case read taskEvents iworld of
(Ok (Queue [] []),iworld) = flushDeferredSDSWrites iworld
(Ok _,iworld) = (Ok (),iworld)
//When we don't run the built-in HTTP server we don't want to loop forever so we stop the loop
//once all tasks are stable
stopOnStable :: !*IWorld -> *(!MaybeError TaskException (), !*IWorld)
......@@ -286,13 +312,6 @@ instance Runnable [TaskWrapper]
where
toRunnable list = list
// Determines the server executables name
determineAppName :: !*World -> (!String,!*World)
determineAppName world
# (appPath, world) = determineAppPath world
= ((dropExtension o dropDirectory) appPath, world)
// Determines the server executables path
determineAppPath :: !*World -> (!FilePath, !*World)
determineAppPath world
......@@ -312,4 +331,13 @@ determineAppPath world
where
cmpFileTime (_,Ok {FileInfo | lastModifiedTime = x})
(_,Ok {FileInfo | lastModifiedTime = y}) = mkTime x > mkTime y
//By default, we use the modification time of the applaction executable as version id
determineAppVersion :: !FilePath!*World -> (!String,!*World)
determineAppVersion appPath world
# (res,world) = getFileInfo appPath world
| res =: (Error _) = ("unknown",world)
# tm = (fromOk res).lastModifiedTime
# version = strfTime "%Y%m%d-%H%M%S" tm
= (version,world)
implementation module iTasks.Extensions.Admin.StoreAdmin
import iTasks
import qualified iTasks.Internal.Store
import qualified iTasks.Internal.Task
import Data.Error
manageStore :: Task ()
......@@ -20,7 +21,7 @@ selectStore
//Low-level access
deleteStore :: (String,String) -> Task ()
deleteStore (namespace,storename) = mkInstantTask eval
deleteStore (namespace,storename) = 'iTasks.Internal.Task'.mkInstantTask eval
where
eval _ iworld = case 'iTasks.Internal.Store'.deleteValue namespace storename iworld of
(Ok (),iworld) = (Ok (),iworld)
......
......@@ -2,7 +2,7 @@ definition module iTasks.Extensions.Admin.TonicAdmin
import iTasks
from iTasks.Internal.Tonic.Images import :: TaskAppRenderer, :: ModelTy, :: ClickMeta, :: TonicImageState, :: ActionState, :: TClickAction
from iTasks.Internal.Tonic.Types import :: AllBlueprints, :: TonicModule, :: TonicFunc, :: FuncName, :: ModuleName, :: NavStack, :: BlueprintIdent
from iTasks.Internal.Tonic.Types import :: AllBlueprints, :: TonicModule, :: TonicFunc, :: FuncName, :: ModuleName, :: NavStack, :: BlueprintIdent, :: ExprId
from Graphics.Scalable import :: TagSource, :: TagRef, :: Image, :: ImageTag
tonicDashboard :: [TaskAppRenderer] -> Task ()
......
......@@ -9,6 +9,7 @@ import iTasks.Internal.Tonic.Types
import iTasks.Internal.Tonic.AbsSyn
import iTasks.Internal.Tonic.Pretty
import iTasks.Internal.Tonic.Images
import iTasks.Internal.Task
import iTasks.UI.Definition
import iTasks.Extensions.DateTime
from StdFunc import seq
......
......@@ -2,6 +2,7 @@ implementation module iTasks.Extensions.Development.Tools
import iTasks
import iTasks.Internal.IWorld, iTasks.Internal.SDS
import System.Environment
import System.OS
CPM_EXE :== IF_POSIX_OR_WINDOWS "bin/cpm" "Tools\\cpm.exe"
......
implementation module iTasks.Extensions.SQLDatabase
import iTasks, Database.SQL, Database.SQL.MySQL, Database.SQL.SQLite, Data.Error, Data.Func, System.FilePath
import iTasks.Internal.IWorld, iTasks.Internal.SDS
import iTasks.Internal.Task, iTasks.Internal.IWorld, iTasks.Internal.SDS
import qualified Data.Map
//Extend Resource type for mysql resources
......@@ -249,8 +249,8 @@ openSQLiteDB :: !SQLDatabase !*IWorld -> (MaybeErrorString (!*SQLiteCursor, !*SQ
openSQLiteDB db iworld=:{IWorld|resources=Just (SQLiteResource con)}
= (Ok con, {IWorld|iworld & resources=Nothing})
openSQLiteDB db iworld=:{IWorld|resources=Nothing}
# iworld=:{IWorld|world,server={paths={dataDirectory}}} = {IWorld|iworld & resources = Nothing}
# db = {db & database = dataDirectory </> db.database}
# iworld=:{IWorld|world,options={storeDirPath}} = {IWorld|iworld & resources = Nothing}
# db = {db & database = storeDirPath </> db.database}
# (err,mbContext,world) = openContext world
| isJust err = (Error (toString (fromJust err)),{IWorld|iworld & world = world})
# (err,mbConn,context) = openConnection db (fromJust mbContext)
......
......@@ -13,7 +13,6 @@ from Data.Set import :: Set, newSet
from iTasks.UI.JS.Interface import :: JSWorld, :: JSEvent, :: JSObj, :: JSObject, :: JSVal
from iTasks.Internal.Client.RunOnClient import createClientIWorld, getUIUpdates
from iTasks.Internal.Engine import background
import iTasks.Internal.IWorld
import Sapl.Target.JS.CodeGeneratorJS, Sapl.Linker.LazyLinker, Sapl.SaplParser
......
......@@ -122,16 +122,18 @@ createClientIWorld serverURL currentInstance
# world = newWorld
# (timestamp=:(Timestamp seed),world) = time world
= {IWorld
|server =
{serverName = "application"
,serverURL = serverURL
,buildID = "build"
,paths = {appDirectory = locundef "appDirectory"
,dataDirectory = locundef "dataDirectory"
,webDirectory = locundef "webDirectory"
,saplDirectory = locundef "saplDirectory"}
}
,config = {sessionTime = 3600, smtpServer = locundef "smtpServer", persistTasks = True}
|options = { appName = "application"
, appPath = locundef "appDirectory"
, appVersion = locundef "appVersion"
, serverPort = 80
, serverUrl = locundef "serverUrl"
, keepaliveTime = locundef "keepaliveTime"
, sessionTime = locundef "sessionTime"
, persistTasks = False
, webDirPath = locundef "webDirectory"
, storeDirPath = locundef "dataDirectory"
, tempDirPath = locundef "tempDirectory"
, saplDirPath = locundef "saplDirectory"}
,clocks =
{ timestamp = timestamp
, localDate = {Date|day = 1, mon = 1, year = 1977}
......
......@@ -10,6 +10,7 @@ from StdFile import class FileSystem
from System.Time import :: Timestamp
from Text.JSON import :: JSONNode
from System.Process import :: ProcessHandle, :: ProcessIO
from iTasks.Engine import :: EngineOptions
from iTasks.UI.Definition import :: UI, :: UINodeType
from iTasks.Internal.TaskState import :: ParallelTaskState, :: TIMeta, :: DeferredJSON
from iTasks.Internal.Task import :: ExternalProcessTask, :: ConnectionTask, :: BackgroundTask
......@@ -29,8 +30,7 @@ from TCPIP import :: TCP_Listener, :: TCP_Listener_, :: TCP_RChannel_, :: TCP_SC
CLEAN_HOME_VAR :== "CLEAN_HOME"
:: *IWorld = { server :: !ServerInfo // Static server info, initialized at startup
, config :: !Config // Server configuration
:: *IWorld = { options :: !EngineOptions // Engine configuration
, clocks :: !SystemClocks // Server side clocks
, current :: !TaskEvalState // Shared state during task evaluation
......@@ -54,26 +54,6 @@ CLEAN_HOME_VAR :== "CLEAN_HOME"
, shutdown :: !Maybe Int // Signals the server function to shut down, the int will be set as exit code
}
:: Config =
{ sessionTime :: !Int //* Time (in seconds) before inactive sessions are garbage collected. Default is 3600 (one hour).
, smtpServer :: !String //* The smtp server to use for sending e-mails
, persistTasks :: !Bool //* Persist the task state to disk
}
:: ServerInfo =
{ serverName :: !String // The name of the server application
, serverURL :: !String // URL of the server like "//any.com:80"
, buildID :: !String // The date/time identifier of the server's build
, paths :: !SystemPaths // Filesystem paths that are used by iTasks
}
:: SystemPaths =
{ appDirectory :: !FilePath // Location of the application's executable
, dataDirectory :: !FilePath // Location of the application's data files
, webDirectory :: !FilePath // List of directories that contain files that are served publicly by the iTask webserver
, saplDirectory :: !FilePath // Location of the application's sapl files
}
:: SystemClocks =
{ timestamp :: !Timestamp
, localDate :: !Date
......@@ -139,7 +119,6 @@ CLEAN_HOME_VAR :== "CLEAN_HOME"
:: BackgroundTaskId :== Int
:: IOStates :== Map TaskId IOState
:: IOState
= IOActive !(Map ConnectionId (!Dynamic,!Bool)) // Bool: stability
......@@ -156,17 +135,12 @@ CLEAN_HOME_VAR :== "CLEAN_HOME"
/**
* Creates and initializes the IWorld state
*
* @param The application's name
* @param The application's path (e.g. to executable).
* @param Persist task administration
* @param The path where static web assets can be found (optional)
* @param The path where the iTasks data store is located (optional)
* @param Path to where the applications's SAPL files are stored (optional)
* @param The engine options
* @param The world
*
* @return An initialized iworld