next up previous contents
Next: The Foreign Function Interface Up: The Structure of Web Previous: The Structure of Web   Contents

Tasks

In many web applications, it's useful to run code at points other than requests from browsers. Ur/Web's task mechanism facilitates this. A type family of task kinds is in the standard library:

\begin{displaymath}\begin{array}{l}
\mathsf{con} \; \mathsf{task\_kind} :: \math...
...athsf{int} \to \mathsf{task\_kind} \; \mathsf{unit}
\end{array}\end{displaymath}

A task kind names a particular extension point of generated applications, where the type parameter of a task kind describes which extra input data is available at that extension point. Add task code with the special declaration form $ \mathsf{task} \; e_1 = e_2$ , where $ e_1$ is a task kind with data $ \tau$ , and $ e_2$ is a function from $ \tau$ to $ \mathsf{transaction} \; \mathsf{unit}$ .

The currently supported task kinds are:


next up previous contents
Next: The Foreign Function Interface Up: The Structure of Web Previous: The Structure of Web   Contents
2014-07-14