Skip to content

Commit de4350f

Browse files
committed
Change start to serve and show the necessary imports from other packages
1 parent 747a097 commit de4350f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: tutorials/4ch.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ module MathServer
120120
, launchMathServer
121121
) where
122122

123+
import Control.Distributed.Process.ManagedProcess
124+
import Control.Distributed.Process.Extras.Time
123125
import .... -- elided
124126

125127
-- We keep this data-type hidden from the outside world, and we ignore
@@ -148,7 +150,7 @@ launchMathServer =
148150
apiHandlers = [ handleCall_ (\(Add x y) -> return (x + y)) ]
149151
, unhandledMessagePolicy = Drop
150152
}
151-
in spawnLocal $ start () (statelessInit Infinity) server >> return ()
153+
in spawnLocal $ serve () (statelessInit Infinity) server >> return ()
152154
{% endhighlight %}
153155

154156

@@ -191,7 +193,7 @@ launchMathServer =
191193
apiHandlers = [ handleRpcChan_ (\chan (Add x y) -> sendChan chan (x + y)) ]
192194
, unhandledMessagePolicy = Drop
193195
}
194-
in spawnLocal $ start () (statelessInit Infinity) server >> return ()
196+
in spawnLocal $ serve () (statelessInit Infinity) server >> return ()
195197
{% endhighlight %}
196198

197199
Ensuring that only valid types are sent to the server is relatively simple,
@@ -230,7 +232,7 @@ launchMathServer =
230232
, handleCast_ (\(Add x y) -> liftIO $ putStrLn $ show (x + y) >> continue_) ]
231233
, unhandledMessagePolicy = Drop
232234
}
233-
in spawnLocal $ start () (statelessInit Infinity) server >> return ()
235+
in spawnLocal $ serve () (statelessInit Infinity) server >> return ()
234236
{% endhighlight %}
235237

236238

0 commit comments

Comments
 (0)