Slap.Cluster.ShardChildren behaviour (slap_cluster v0.4.0)

Copy Markdown View Source

Starts application processes for a shard after its database opens.

A module used as shard_children: {module, :child_specs, args} can implement validate_child_options!/1. The cluster calls it before starting, so a configuration error does not leave shards retrying their startup.

Summary

Callbacks

Raises ArgumentError for invalid application settings.

Callbacks

child_specs(t)

@callback child_specs(Slap.Cluster.Shard.t()) :: [
  Supervisor.child_spec() | {module(), term()}
]

validate_child_options!(keyword)

(optional)
@callback validate_child_options!(keyword()) :: :ok

Raises ArgumentError for invalid application settings.