# `NoNoncense.MachineId.ConflictGuard`
[🔗](https://github.com/juulSme/NoNoncense/blob/v1.3.0/lib/no_noncense/machine_id/conflict_guard.ex#L1)

Guards against machine ID conflicts between nodes. If a new node joins the cluster with the same ID, it is sent the machine IDs of all existing nodes, will become aware of the ID conflict and will call the `on_conflict` callback that can take action to prevent bad stuff from happening (for example, that the uniqueness guarantee of `NoNoncense` will no longer hold).

By default, the `on_conflict` callback emergeny shuts down the entire node using `:erlang.halt/1` with status code 111.

Of course, all of this only works if the nodes are actually connected to one another.

# `opts`

```elixir
@type opts() :: [
  name: module(),
  on_conflict: (-&gt; any()),
  machine_id: non_neg_integer()
]
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link(opts()) :: GenServer.on_start()
```

Let's get this puppy going!

---

*Consult [api-reference.md](api-reference.md) for complete listing*
