98683e70d273b2ed0485d23993f3a639b010123a
[ri1617.git] / architecture / itasks.tex
1 \subsubsection{\iTasks{} task}
2 To make the integration of \mTask{}s in \iTasks{} more orthogonal we need a
3 special kind of task that serves as a mothertask that has the type visible in
4 Listing~\ref{lst:mothertask}. At first the system must be initialized with the
5 first given function. This will setup the necessary communication tasks and
6 SDSs used for interal storage and communication. This task is automatically
7 started when the system boots up. To add a task one has to call \CI{addmTask}
8 which will send the task to the system and evaluate it. Currently the only way
9 of getting info back is through SDSs that are used in the \mTask. Some tasks
10 are designed to run indefinite, for example temperature monitoring, and to
11 remove them the \CI{delmTask} function is introduced that will remove the task
12 and return a success value.
13
14 \begin{lstlisting}[language=Clean,label={lst:mothertask}]
15 mTask :: DeviceSpec -> Task ()
16 addmTask :: (ByteCode a p) -> Task Int
17 delmTask :: Int -> Task Bool
18 \end{lstlisting}
19
20 \subsubsection{Shared Data Sources}
21 \mTask{}s can use SDSs for means of storing information and for communicating
22 with the server. Communication can be slow and therefore SDSs are only updated
23 when a task specifically asks for it through the bytecode instructions for
24 publishing and getting SDS values.
25
26 \todo{Uitleg over synchronisatie als de sds op de server veranderd}