Comments (8)
You should be able to do whatever you want with the errors in your index.js file. It is emitted as log, debug, or error. So you could do
const Admiral = new Fleet(options);
Admiral.on('log', m => {
// Do whatever you want with the log
});
Admiral.on('debug', m => {
// Do whatever you want with the log
});
Admiral.on('error', m => {
// Do whatever you want with the log
});
from eris-fleet.
Got it. Side question as well ~ how do you set the shard's status? Workers don't seem to receive any ready event.
from eris-fleet.
Each cluster is considered ready when all the shards within that cluster are ready. Your code loads after all shards within a cluster are ready.
from eris-fleet.
So theoretically, slapping the editStatus
code anywhere in the bot.js
would work?
from eris-fleet.
Yes, you shouldn't have to worry about the client not being ready in your bot.js file since it only loads the code when the client is ready.
from eris-fleet.
Sounds good. One last question that just popped up:
Are stats not first known on start up? Tried using the ipc.getStats()
function and it returns this:
{"guilds":0,"users":0,"clustersRam":0,"voice":0,"largeGuilds":0,"shardCount":0,"clusters":[]}
from eris-fleet.
Stats are started once all services and clusters have launched. It may be possible to give stats as each cluster comes online, but this will give inaccurate stats so I'm conflicted on making that change. If I give 0 for each value, then your code can know if the stats are not ready since everything is 0. You can listen for stats updates by registering the "stats" event in IPC. Here's an example:
this.ipc.register("stats", (message) => {
const stats = message.msg;
// Do stuff with the stats
});
from eris-fleet.
I'd like it to be an option. Otherwise looks good, I can just wait until the stats are ready.
from eris-fleet.
Related Issues (12)
- How do I have the events emitted by Fleet in their own files?
- Prefix missing after restarting HOT 4
- workerID of undefined HOT 5
- Shard disconnect error with undefined HOT 1
- Incorrect amount of users on clusters HOT 6
- shutdowns giving "TypeError: Cannot redefine property: _token" HOT 1
- Shutdown stops after failure inside shutdown function HOT 1
- Workers stuck and never connect HOT 1
- incorrectly typing id parameters as numbers
- shard undefined
- Add more IPC shardstats properties HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eris-fleet.