The Duper Application

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

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 is to add a hash/path pair to the map, and the second is to retrieve entries that have more than one path in the value (because these are two duplicate files).

This is similar to the code we wrote for the sequence stash:

Get hands-on with 1200+ tech skills courses.