Skip to main content

process

Function process 

Source
pub fn process() -> Result<Option<ClusterAssignment>, ClusterError>
Expand description

Tells whether this process was started by a ClusterManager (D-300): its assignment (cluster ID, shards, the way to the manager) if it was, None in the first process.

The assignment comes from an environment variable the manager sets; it is checked (shards within the total, the manager on a loopback address) but nothing is connected yet: the client connects when it logs in.

discord.js counterpart: the environment ShardClientUtil reads.

ยงErrors

ClusterError::Assignment if the variable is set but is not a valid assignment.