4.1.50 kick_site(Site, Intent)

-spec kick_site(site(), kick_intent()) -> ok |
                                          {error, _}.

Remove a site from the cluster. Target site can be local or remote: it is allowed for a site to kick itself from the cluster.

The kicked site creates an entirely new cluster ID, and joins it as a singleton member.

Local site (one that initiates kick) runs the following hooks with Intent equal to the value of the argument:

  1. classy:pre_kick/2. It can decide that removing a site is unsafe and abort the command.
  2. classy:on_leave/2. This hook is executed after the target is successfully kicked.

NOTE: the intent is not propagated across different sites. If the target site is not the same as the local site, then the target runs classy:on_leave/2 with pre-defined intent kicked.

JavaScript license information