# `Cluster.Strategy`
[🔗](https://github.com/bitwalker/libcluster/blob/3.6.0/lib/strategy/strategy.ex#L1)

This module defines the behaviour for implementing clustering strategies.

# `bad_nodes`

```elixir
@type bad_nodes() :: [{node(), reason :: term()}]
```

# `mfa_tuple`

```elixir
@type mfa_tuple() :: {module(), atom(), [term()]}
```

# `strategy_args`

```elixir
@type strategy_args() :: [Cluster.Strategy.State.t()]
```

# `topology`

```elixir
@type topology() :: atom()
```

# `child_spec`

```elixir
@callback child_spec(strategy_args()) :: Supervisor.child_spec()
```

# `start_link`

```elixir
@callback start_link(strategy_args()) ::
  {:ok, pid()} | :ignore | {:error, reason :: term()}
```

# `connect_nodes`

```elixir
@spec connect_nodes(topology(), mfa_tuple(), mfa_tuple(), [atom()]) ::
  :ok | {:error, bad_nodes()}
```

Given a list of node names, attempts to connect to all of them.
Returns `:ok` if all nodes connected, or `{:error, [{node, reason}, ..]}`
if we failed to connect to some nodes.

All failures are logged.

# `difference`

# `disconnect_nodes`

```elixir
@spec disconnect_nodes(topology(), mfa_tuple(), mfa_tuple(), [atom()]) ::
  :ok | {:error, bad_nodes()}
```

Given a list of node names, attempts to disconnect from all of them.
Returns `:ok` if all nodes disconnected, or `{:error, [{node, reason}, ..]}`
if we failed to disconnect from some nodes.

All failures are logged.

# `intersection`

---

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