# `Slap.Cluster.Shard`
[🔗](https://github.com/mjrusso/slap/blob/slap_cluster-v0.4.0/slap_cluster/lib/slap/cluster/shard.ex#L1)

The context of a shard placed on this node, given to the application's
shard children and to functions run with `call/3`.

  * `:cluster` - the cluster module.
  * `:n` - the shard number, `0..shards - 1`.
  * `:db` - the open `Slap.SlateDB` handle. Read and write through it directly.
  * `:registry` - the cluster's `Registry`. Name per-shard processes with
    the cluster's `via/2`, which scopes names to `{n, name}`.
  * `:generation` - the strategy's lease generation, or `nil` (`Local`).
  * `:child_options` - application settings passed to shard children.

`:status` and `:shard_db` are internal coordination fields. Use
`Slap.Cluster.shard_status/1` to inspect the shard's state.

A context is only valid while the shard is open on this node. When the
shard stops, `Slap.Cluster.shard_status/1` says why.

# `t`

```elixir
@type t() :: %Slap.Cluster.Shard{
  child_options: keyword(),
  cluster: module(),
  db: Slap.SlateDB.t(),
  generation: non_neg_integer() | nil,
  n: non_neg_integer(),
  registry: atom(),
  shard_db: pid(),
  status: :atomics.atomics_ref()
}
```

---

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