May 2018
Intermediate to advanced
412 pages
9h 3m
English
We’ll start by creating a supervised application:
| | $ mix new --sup duper |
| | $ cd duper |
| | $ git init |
| | $ git add . |
| | $ git commit -a -m 'raw application' |
Time to start writing servers.
The results server wraps an Elixir map. When it starts, it sets its state to an empty map. The keys of this map are hash values, and the values are the list of one of more paths whose files have that hash.
The server provides two API calls: one to add a hash/path pair to the map, the second to retrieve entries that have more than one path in the value (as these are two duplicate files).
This is similar to the code we wrote for the sequence stash:
Read now
Unlock full access