@@ -10,6 +10,12 @@ In order to explore the `ManagedProcess` API, we will present a simple
10
10
example taken from the test suite, which exercises some of the more
11
11
interesting features.
12
12
13
+ The main idea behind ` ManagedProcess ` is to separate the functional
14
+ and non-functional aspects of a process. By functional, we mean whatever
15
+ application specific task the process performs, and by non-functional
16
+ we mean the * concurrency* or, more precisely, handling of the process'
17
+ mailbox.
18
+
13
19
Let's imagine we want to execute tasks on an arbitrary node, using a
14
20
mechanism much as we would with the ` call ` API from distributed-process.
15
21
As with ` call ` , we want the caller to block whilst the remote task is
@@ -29,4 +35,21 @@ from the backlog and executed.
29
35
such as this, based on the synchronous ` call ` and asynchronous ` cast `
30
36
functions. Although ` call ` is synchronous, communication with the
31
37
* server process* is out of band, both from the client and the server's
32
- point of view.
38
+ point of view. The server implementation chooses whether to reply to
39
+ a call request immediately, or defer its reply until a later stage
40
+ and go back to receiving messages in the meanwhile.
41
+
42
+ ### Implementation Sketch
43
+
44
+ We start out with some types: the tasks we perform and the maximum
45
+ pool size:
46
+
47
+ {% highlight haskell %}
48
+ type PoolSize = Int
49
+ type SimpleTask a = Closure (Process a)
50
+ {% endhighlight %}
51
+
52
+ To submit a task, our clients will submit an action in the process
53
+ monad, wrapped in a ` Closure ` environment. We will use the ` Addressable `
54
+ typeclass to allow clients to specify the server's location in whatever
55
+ manner suits them.
0 commit comments