User Tools

Site Tools


cs330_f2016:labz

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cs330_f2016:labz [2017/03/24 22:48]
dhart [Part 1: Name Server:]
cs330_f2016:labz [2021/06/30 23:42] (current)
Line 3: Line 3:
 To gain more significant experience in programming elixir, by implementing a server and constructing a supervisor tree. To gain more significant experience in programming elixir, by implementing a server and constructing a supervisor tree.
  
----- +===Pre-requisites:​===
-====Pre-requisites:​====+
  
 For this lab, you will need the [[http://​liftothers.org/​dokuwiki/​doku.php?​id=cs330_f2016:​lab13scaffold|scaffolding code]]. For this lab, you will need the [[http://​liftothers.org/​dokuwiki/​doku.php?​id=cs330_f2016:​lab13scaffold|scaffolding code]].
Line 38: Line 37:
  
 We have provided a skeleton of some GenServer code [[http://​liftothers.org/​dokuwiki/​doku.php?​id=cs330_f2016:​lab13genserver|here]]. We have provided a skeleton of some GenServer code [[http://​liftothers.org/​dokuwiki/​doku.php?​id=cs330_f2016:​lab13genserver|here]].
- 
-Any time a pid goes down you will need to remove it from the name server, this is best done by placing a monitor on the pid before you put it into your data structure. The process will then notify the server through its handle_info function. 
  
 ===Hints:​=== ===Hints:​===
Line 51: Line 48:
 Example: Example:
 <code elixir> <code elixir>
-def handle_call({:​register,​ name}, pid, mymap) do+def handle_call({:​register,​ name}, ​{pid, _from}, mymap) do
   ...   ...
   {:reply, :ok, mymap}   {:reply, :ok, mymap}
Line 127: Line 124:
 Helpful links:\\ Helpful links:\\
 https://​hexdocs.pm/​elixir/​Supervisor.html \\ https://​hexdocs.pm/​elixir/​Supervisor.html \\
 +
 +----
 +====Submitting Your Lab====
 +For submitting this lab, please put all of your code into a single file called "​Elixir2.ex"​. This should include all of the code from the provided modules, all of the code for you name server, and all of your code for your supervisor modules. ​
  
cs330_f2016/labz.1490395682.txt.gz · Last modified: 2021/06/30 23:40 (external edit)