Skip to content

Commit 0da3c08

Browse files
committed
Replace a few references to platform to the now more specific projects.
1 parent f789ef6 commit 0da3c08

File tree

3 files changed

+40
-41
lines changed

3 files changed

+40
-41
lines changed

tutorials/3ch.md

+26-26
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ proxy :: Serializable a => ProcessId -> (a -> Process Bool) -> Process ()
177177
{% endhighlight %}
178178

179179
Since `matchAny` operates on `(Message -> Process b)` and `handleMessage` operates on
180-
`a -> Process b` we can compose these to make our proxy server. We must not forward
180+
`a -> Process b` we can compose these to make our proxy server. We must not forward
181181
messages for which the predicate function evaluates to `Just False`, nor can we sensibly
182-
forward messages which the predicate function is unable to evaluate due to type
182+
forward messages which the predicate function is unable to evaluate due to type
183183
incompatibility. This leaves us with the definition found in distributed-process:
184184

185185
{% highlight haskell %}
@@ -197,7 +197,7 @@ proxy pid proc = do
197197

198198
Beyond simple relays and proxies, the raw message handling capabilities available in
199199
distributed-process can be utilised to develop highly generic message processing code.
200-
All the richness of the distributed-process-platform APIs (such as `ManagedProcess`) which
200+
All the richness of the distributed-process-client-server APIs (such as `ManagedProcess`) which
201201
will be discussed in later tutorials are, in fact, built upon these families of primitives.
202202

203203
### Typed Channels
@@ -234,10 +234,10 @@ is terminated.
234234

235235
The `ProcessExitException` signal is sent from one process to another, indicating that the
236236
receiver is being asked to terminate. A process can choose to tell itself to exit, and the
237-
[`die`][7] primitive simplifies doing so without worrying about the expected type for the
237+
[`die`][7] primitive simplifies doing so without worrying about the expected type for the
238238
action. In fact, [`die`][7] has slightly different semantics from [`exit`][5], since the
239239
latter involves sending an internal signal to the local node controller. A direct consequence
240-
of this is that the _exit signal_ may not arrive immediately, since the _Node Controller_ could
240+
of this is that the _exit signal_ may not arrive immediately, since the _Node Controller_ could
241241
be busy processing other events. On the other hand, the [`die`][7] primitive throws a
242242
`ProcessExitException` directly in the calling thread, thus terminating it without delay.
243243
In practise, this means the following two functions could behave quite differently at
@@ -247,19 +247,19 @@ runtime:
247247

248248
-- this will never print anything...
249249
demo1 = die "Boom" >> expect >>= say
250-
250+
251251
-- this /might/ print something before it exits
252252
demo2 = do
253253
self <- getSelfPid
254254
exit self "Boom"
255-
expect >>= say
255+
expect >>= say
256256
{% endhighlight %}
257257

258258
The `ProcessExitException` type holds a _reason_ field, which is serialised as a raw `Message`.
259259
This exception type is exported, so it is possible to catch these _exit signals_ and decide how
260260
to respond to them. Catching _exit signals_ is done via a set of primitives in
261261
distributed-process, and the use of them forms a key component of the various fault tolerance
262-
strategies provided by distributed-process-platform.
262+
strategies provided by distributed-process-supervisor.
263263

264264
A `ProcessKillException` is intended to be an _untrappable_ exit signal, so its type is
265265
not exported and therefore you can __only__ handle it by catching all exceptions, which
@@ -296,7 +296,7 @@ special case. Since link exit signals cannot be caught directly, if you find you
296296
to _trap_ a link failure, you probably want to use a monitor instead.
297297

298298
Whilst the built-in `link` primitive terminates the link-ee regardless of exit reason,
299-
distributed-process-platform provides an alternate function `linkOnFailure`, which only
299+
distributed-process-extras provides an alternate function `linkOnFailure`, which only
300300
dispatches the `ProcessLinkException` if the link-ed process dies abnormally (i.e., with
301301
some `DiedReason` other than `DiedNormal`).
302302

@@ -305,7 +305,7 @@ putting a `ProcessMonitorNotification` into the process' mailbox. This signal an
305305
constituent fields can be introspected in order to decide what action (if any) the receiver
306306
can/should take in response to the monitored process' death. Let's take a look at how
307307
monitors can be used to determine both when and _how_ a process has terminated. Tucked
308-
away in distributed-process-platform, the `linkOnFailure` primitive works in exactly this
308+
away in distributed-process-extras, the `linkOnFailure` primitive works in exactly this
309309
way, only terminating the caller if the subject terminates abnormally. Let's take a look...
310310

311311
{% highlight haskell %}
@@ -366,17 +366,17 @@ process. The `ProcessInfo` type it returns contains the local node id and a list
366366
registered names, monitors and links for the process. The call returns `Nothing` if the
367367
process in question is not alive.
368368

369-
### Monad Transformer Stacks
369+
### Monad Transformer Stacks
370370

371-
It is not generally necessary, but it may be convenient in your application to use a
372-
custom monad transformer stack with the Process monad at the bottom. For example,
371+
It is not generally necessary, but it may be convenient in your application to use a
372+
custom monad transformer stack with the Process monad at the bottom. For example,
373373
you may have decided that in various places in your application you will make calls to
374374
a network database. You may create a data access module, and it will need configuration information available to it in
375-
order to connect to the database server. A ReaderT can be a nice way to make
375+
order to connect to the database server. A ReaderT can be a nice way to make
376376
configuration data available throughout an application without
377-
schlepping it around by hand.
377+
schlepping it around by hand.
378378

379-
This example is a bit contrived and over-simplified but
379+
This example is a bit contrived and over-simplified but
380380
illustrates the concept. Consider the `fetchUser` function below, it runs in the `AppProcess`
381381
monad which provides the configuration settings required to connect to the database:
382382

@@ -409,7 +409,7 @@ openDB = do
409409

410410
closeDB :: DB.Connection -> AppProcess ()
411411
closeDB db = liftIO (DB.close db)
412-
412+
413413
{% endhighlight %}
414414

415415
So this would mostly work but it is not complete. What happens if an exception
@@ -423,17 +423,17 @@ In the base library, [bracket][brkt] is defined in Control.Exception with this s
423423
bracket :: IO a --^ computation to run first ("acquire resource")
424424
-> (a -> IO b) --^ computation to run last ("release resource")
425425
-> (a -> IO c) --^ computation to run in-between
426-
-> IO c
426+
-> IO c
427427

428428
{% endhighlight %}
429429

430430
Great! We pass an IO action that acquires a resource; `bracket` passes that
431431
resource to a function which takes the resource and runs another action.
432-
We also provide a release function which `bracket` is guaranteed to run
433-
even if the primary action raises an exception.
432+
We also provide a release function which `bracket` is guaranteed to run
433+
even if the primary action raises an exception.
434434

435435

436-
Unfortunately, we cannot directly use `bracket` in our
436+
Unfortunately, we cannot directly use `bracket` in our
437437
`fetchUser` function: openDB (resource acquisition) runs in the `AppProcess`
438438
monad. If our functions ran in IO, we could lift the entire bracket computation into
439439
our monad transformer stack with liftIO; but we cannot do that for the computations
@@ -473,7 +473,7 @@ onException p what = p `catch` \e -> do _ <- what
473473

474474
`distributed-process` needs to do this sort of thing to keep its dependency
475475
list small, but do we really want to write this for every transformer stack
476-
we use in our own applications? No! And we do not have to, thanks to
476+
we use in our own applications? No! And we do not have to, thanks to
477477
the [monad-control][mctrl] and [lifted-base][lbase] libraries.
478478

479479
[monad-control][mctrl] provides several typeclasses and helper functions
@@ -489,17 +489,17 @@ bracket that looks like this:
489489

490490
{% highlight haskell %}
491491

492-
bracket :: MonadBaseControl IO m
492+
bracket :: MonadBaseControl IO m
493493
=> m a --^ computation to run first ("acquire resource")
494494
-> (a -> m b) --^ computation to run last ("release resource")
495495
-> (a -> m c) --^ computation to run in-between
496-
-> m c
496+
-> m c
497497

498498
{% endhighlight %}
499499

500500
It is just the same as the version found in base, except it is generalized to work
501501
with actions in any monad that implements [MonadBaseControl IO][mbc]. [monad-control][mctrl] defines
502-
instances for the standard transformers, but that instance requires the base monad
502+
instances for the standard transformers, but that instance requires the base monad
503503
(in this case, `Process`) to also have an instance of these classes.
504504

505505
To address this the [distributed-process-monad-control][dpmc] package
@@ -520,7 +520,7 @@ fetchUser email =
520520
Lifted.bracket openDB
521521
closeDB
522522
$ \db -> liftIO $ DB.query db email
523-
523+
524524

525525
{% endhighlight %}
526526

tutorials/4ch.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ title: 4. Managed Process Tutorial
88
### Introduction
99

1010
The source code for this tutorial is based on the `BlockingQueue` API
11-
from distributed-process-platform and can be accessed [here][1].
11+
from distributed-process-task and can be accessed [here][1].
1212
Please note that this tutorial is based on the stable (master) branch
13-
of [distributed-process-platform][3].
13+
of [distributed-process-task][3].
1414

1515
### Managed Processes
1616

@@ -40,8 +40,8 @@ code to be run on termination/shutdown.
4040

4141
{% highlight haskell %}
4242
myServer :: ProcessDefinition MyStateType
43-
myServer =
44-
ProcessDefinition {
43+
myServer =
44+
ProcessDefinition {
4545
-- handle messages sent to us via the call/cast API functions
4646
apiHandlers = [
4747
-- a list of Dispatchers, derived by calling on of the various
@@ -113,7 +113,7 @@ that math server that does just that:
113113
----
114114

115115
{% highlight haskell %}
116-
module MathServer
116+
module MathServer
117117
( -- client facing API
118118
add
119119
-- starting/spawning the server process
@@ -241,9 +241,9 @@ more interesting and useful.
241241
### Building a Task Queue
242242

243243
This section of the tutorial is based on a real module from the
244-
distributed-process-platform library, called `BlockingQueue`.
244+
distributed-process-task library, called `BlockingQueue`.
245245

246-
Let's imagine we want to execute tasks on an arbitrary node, but want
246+
Let's imagine we want to execute tasks on an arbitrary node, but want
247247
the caller to block whilst the remote task is executing. We also want
248248
to put an upper bound on the number of concurrent tasks/callers that
249249
the server will accept. Let's use `ManagedProcess` to implement a generic
@@ -275,7 +275,7 @@ typeclass to allow clients to specify the server's location in whatever
275275
manner suits them: The type of a task will be `Closure (Process a)` and
276276
the server will explicitly return an /either/ value with `Left String`
277277
for errors and `Right a` for successful results.
278-
278+
279279
{% highlight haskell %}
280280
-- enqueues the task in the pool and blocks
281281
-- the caller until the task is complete
@@ -663,8 +663,8 @@ another to monitor the first and handle failures and/or cancellation. Spawning
663663
processes is cheap, but not free as each process is a haskell thread, plus some
664664
additional book keeping data.
665665

666-
[1]: https://github.com/haskell-distributed/distributed-process-platform/blob/master/src/Control/Distributed/Process/Platform/Task/Queue/BlockingQueue.hs
666+
[1]: https://github.com/haskell-distributed/distributed-process-task/blob/master/src/Control/Distributed/Process/Task/Queue/BlockingQueue.hs
667667
[2]: /static/doc/distributed-process-platform/Control-Distributed-Process-Platform-ManagedProcess.html#t:ProcessDefinition
668-
[3]: https://github.com/haskell-distributed/distributed-process-platform/tree/master/
669-
[4]: https://github.com/haskell-distributed/distributed-process-platform/tree/master/src/Control/Distributed/Process/Platform/UnsafePrimitives.hs
668+
[3]: https://github.com/haskell-distributed/distributed-process-task
669+
[4]: https://github.com/haskell-distributed/distributed-process-extras/blob/master/src/Control/Distributed/Process/Extras/UnsafePrimitives.hs
670670
[5]: /documentation.html

tutorials/5ch.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ triggered the shutdown/terminate sequence for the supervisor's process explicitl
5656
When a supervisor is told directly to terminate a child process, it uses the
5757
`ChildTerminationPolicy` to determine whether the child should be terminated
5858
_gracefully_ or _brutally killed_. This _shutdown protocol_ is used throughout
59-
[distributed-process-platform][dpp] and in order for a child process to be managed
59+
[distributed-process-supervisor][dpp] and in order for a child process to be managed
6060
effectively by its supervisor, it is imperative that it understands the protocol.
6161
When a _graceful_ shutdown is required, the supervisor will send an exit signal to the
6262
child process, with the `ExitReason` set to `ExitShutdown`, whence the child process is
@@ -70,7 +70,7 @@ provide a timeout value. The supervisor attempts a _gracefull_ shutdown initiall
7070
however if the child does not exit within the given time window, the supervisor will
7171
automatically revert to a _brutal kill_ using `TerminateImmediately`. If the
7272
timeout value is set to `Infinity`, the supervisor will wait indefintiely for the
73-
child to exit cleanly.
73+
child to exit cleanly.
7474

7575
When a supervisor detects a child exit, it will attempt a restart. Whilst explicitly
7676
terminating a child will **only** terminate the specified child process, unexpected
@@ -142,11 +142,10 @@ order, otherwise the dependent children might crash whilst we're restarting othe
142142
rely on. It follows that, in this setup, we cannot subsequently (re)start the children in the
143143
same order we stopped them either.
144144

145-
[dpp]: https://github.com/haskell-distributed/distributed-process-platform
145+
[dpp]: https://github.com/haskell-distributed/distributed-process-supervisor
146146
[sup1]: /img/one-for-one.png
147147
[sup2]: /img/one-for-all.png
148148
[sup3]: /img/one-for-all-left-to-right.png
149149
[alert]: /img/alert.png
150150
[info]: /img/info.png
151151
[erlsup]: http://www.erlang.org/doc/man/supervisor.html
152-

0 commit comments

Comments
 (0)