TaskServer.dcl 1.4 KB
Newer Older
1
definition module iTasks.Internal.TaskServer
2

Mart Lubbers's avatar
Mart Lubbers committed
3 4
from iTasks.Internal.IWorld import :: ConnectionId
from iTasks.Internal.SDS import :: SDSSource
5

6 7 8 9
from Data.Maybe 		import :: Maybe
from StdFile			import class FileSystem
from TCPIP				import class ChannelEnv, :: IPAddress, :: Timeout
from Internet.HTTP		import :: HTTPRequest, :: HTTPResponse
10
from System.FilePath    import :: FilePath
11

12
from Data.Error               import :: MaybeError
Mart Lubbers's avatar
Mart Lubbers committed
13
from Data.Map                 import :: Map
14
from iTasks.WF.Definition     import :: TaskId
15
from iTasks.Internal.IWorld	  import :: IWorld
16
from iTasks.Internal.Task     import :: ConnectionTask, :: TaskException
17
from iTasks.Internal.IWorld   import :: IWorld, :: IOStates, :: IOState
Mart Lubbers's avatar
Mart Lubbers committed
18 19
from iTasks.Internal.IWorld	  import :: IWorld
from iTasks.Internal.Task     import :: ConnectionTask, :: TaskException
20
from iTasks.Engine            import :: StartupTask
21

22
//Core task server loop
23
serve :: ![StartupTask] ![(Int,ConnectionTask)] (*IWorld -> (Maybe Timeout,*IWorld)) *IWorld -> *IWorld
24 25

//Dynamically add a listener
26
addListener :: !TaskId !Int !Bool !(ConnectionTask) !*IWorld -> (!MaybeError TaskException (),!*IWorld)
27 28

//Dynamically add a connection
29
addConnection :: !TaskId !String !Int !(Maybe Timeout) !ConnectionTask !*IWorld -> (!MaybeError TaskException (ConnectionId, Dynamic),!*IWorld)
Mart Lubbers's avatar
Mart Lubbers committed
30

31 32
ioStateString :: !IOStates -> String

33 34
//Ticks every time the server loops once
tick :: SDSSource () () ()