Git Product home page Git Product logo

discord.js-cluster's Introduction

Discord.js Sharder

Patreon Discord Travis (.com) David node-current GitHub package.json version RunKit

Table of Contents

About

discord.js-cluster is a powerful cluster manager for the Discord.js library which implements multiprocessing to increase the performance of your client, heavily inspired by the Discord.js built-in ShardingManager.
Using the Node.js cluster module, Discord.js Cluster spreads all ShardingManagers evenly among cores, and is easy to implement!

Installation

With npm:

$ npm install discord.js-cluster

With yarn:

$ yarn add discord.js-cluster

Usage

Can be used exactly like the ShardingManager
index.js:

const { ClusterManager } = require('discord.js-cluster');

const manager = new ClusterManager('./bot.js', { token: 'your-token-goes-here' });

manager.on('clusterCreate', cluster => console.log(`Launched cluster ${cluster.id}`));

manager.spawn();

bot.js:

const { Client } = require('discord.js-cluster');
const { Intents } = require('discord.js');

const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

client.on('ready', () => console.log(`Cluster ${client.cluster.id} is ready!`));

client.login(); // no token is required here!

You can find more documentation on the website.

discord.js-cluster's People

Contributors

dependabot[bot] avatar mrgriefs avatar rubenortz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

discord.js-cluster's Issues

Threading logic

Hey there, now that I've thought about it, how are threads distributed across the machine? Are there multiple processes per cpu core, and do threads share the same process id? This would be useful in calculating and reducing ram usage into a single value since I'd need to know if I should filter out duplicate process ids. Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.