Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hikari-clusters

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hikari-clusters

An advanced yet easy-to-use clustering tool for Hikari.

  • 1.2.0
  • PyPI
  • Socket score

Maintainers
1

hikari-clusters

pypi pre-commit.ci status

Documentation

hikari-clusters allows you to scale your Discord bots horizontally by using multiprocessing and websockets. This means that your bot can use multiple cores, as well as multiple VPSes.

See the #clusters channel in the hikari-py discord for help.

# brain.py
from hikari_clusters import Brain

Brain(
    host="localhost",
    port=8765,
    token="ipc token",
    total_servers=1,
    clusters_per_server=2,
    shards_per_cluster=3,
).run()
# server.py
from hikari import GatewayBot
from hikari_clusters import Cluster, ClusterLauncher, Server

class MyBot(GatewayBot):
    cluster: Cluster

    def __init__(self):
        super().__init__(token="discord token")

        # load modules & events here

Server(
    host="localhost",
    port=8765,
    token="ipc token",
    cluster_launcher=ClusterLauncher(MyBot),
).run()

Run examples with python -m examples.<example name> (python -m examples.basic)

Creating Self-Signed Certificate:

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout cert.key -out cert.cert && cat cert.key cert.cert > cert.pem

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc