new Cluster(message_obj)
Represents a cluster. Perform communication between Bots and cluster management.
Parameters:
Name | Type | Description |
---|---|---|
message_obj |
Message |
- Source:
Members
(private, inner) stats_obj :Stat
Stat object
Type:
- Stat
- Source:
Methods
closeBot(bot_name, fn)
Sends close request to the specified bot.
Parameters:
Name | Type | Description |
---|---|---|
bot_name |
String | |
fn |
function | callback |
- Source:
getBotConfig(bot_name, fn)
Returns bot config of another bot in the cluster.
Parameters:
Name | Type | Description |
---|---|---|
bot_name |
String | |
fn |
function | callback |
- Source:
getMaster(fn)
Returns info about current cluster master.
This method is also called periodically to refetch master and other bot info.
Parameters:
Name | Type | Description |
---|---|---|
fn |
function | callback |
- Source:
removeBot(bot_name)
Removes the bot from the cluster.
Parameters:
Name | Type | Description |
---|---|---|
bot_name |
String |
- Source:
send(to, msg, fn)
Sends a msg to another bot.
Parameters:
Name | Type | Description |
---|---|---|
to |
String | bot_name |
msg |
Object | |
fn |
function | callback |
- Source:
sendTo(host, port, msg, fn)
Sends a msg to another bot by host and port params.
Parameters:
Name | Type | Description |
---|---|---|
host |
String | |
port |
String | |
msg |
Object | |
fn |
function | callback |
- Source:
setBot(b)
Sets bot object into the cluster.
Parameters:
Name | Type | Description |
---|---|---|
b |
Bot |
- Source:
(private, inner) msg()
Used to call Logger object with the caller function name.
- Source: