# hikari-clusters
[![pypi](https://github.com/TrigonDev/hikari-clusters/actions/workflows/pypi.yml/badge.svg)](https://pypi.org/project/hikari-clusters)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/TrigonDev/hikari-clusters/main.svg)](https://results.pre-commit.ci/latest/github/TrigonDev/hikari-clusters/main)
[Documentation](https://github.com/circuitsacul/hikari-clusters/wiki)
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.
```py
# 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()
```
```py
# 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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/TrigonDev/hikari-clusters",
"name": "hikari-clusters",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.14,>=3.9",
"maintainer_email": null,
"keywords": "hikari, discord, clustering, bot, ipc",
"author": "Circuit",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/ec/7b/b0b4161e1cfe72f95bb84c1dab0b05410385c21698fff042f09e62235a6b/hikari_clusters-1.2.0.tar.gz",
"platform": null,
"description": "# hikari-clusters\n[![pypi](https://github.com/TrigonDev/hikari-clusters/actions/workflows/pypi.yml/badge.svg)](https://pypi.org/project/hikari-clusters)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/TrigonDev/hikari-clusters/main.svg)](https://results.pre-commit.ci/latest/github/TrigonDev/hikari-clusters/main)\n\n[Documentation](https://github.com/circuitsacul/hikari-clusters/wiki)\n\nhikari-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.\n\nSee the #clusters channel in the hikari-py discord for help.\n\n```py\n# brain.py\nfrom hikari_clusters import Brain\n\nBrain(\n host=\"localhost\",\n port=8765,\n token=\"ipc token\",\n total_servers=1,\n clusters_per_server=2,\n shards_per_cluster=3,\n).run()\n```\n```py\n# server.py\nfrom hikari import GatewayBot\nfrom hikari_clusters import Cluster, ClusterLauncher, Server\n\nclass MyBot(GatewayBot):\n cluster: Cluster\n\n def __init__(self):\n super().__init__(token=\"discord token\")\n\n # load modules & events here\n\nServer(\n host=\"localhost\",\n port=8765,\n token=\"ipc token\",\n cluster_launcher=ClusterLauncher(MyBot),\n).run()\n```\n\nRun examples with `python -m examples.<example name>` (`python -m examples.basic`)\n\n## Creating Self-Signed Certificate:\n```\nopenssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout cert.key -out cert.cert && cat cert.key cert.cert > cert.pem\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An advanced yet easy-to-use clustering tool for Hikari.",
"version": "1.2.0",
"project_urls": {
"Documentation": "https://github.com/TrigonDev/hikari-clusters/wiki",
"Homepage": "https://github.com/TrigonDev/hikari-clusters",
"Repository": "https://github.com/TrigonDev/hikari-clusters"
},
"split_keywords": [
"hikari",
" discord",
" clustering",
" bot",
" ipc"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9b371a572ec1793fe604c15e4da1e7c2803c14541f19ac755d1303a50786a4fb",
"md5": "f6ff324430019c88c751d58c27379e75",
"sha256": "6c2defccac73250a0c27267704696d4f6ed2220b01a76b9da0f3730ea8a1ea9f"
},
"downloads": -1,
"filename": "hikari_clusters-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f6ff324430019c88c751d58c27379e75",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.14,>=3.9",
"size": 24303,
"upload_time": "2024-10-11T01:17:42",
"upload_time_iso_8601": "2024-10-11T01:17:42.948319Z",
"url": "https://files.pythonhosted.org/packages/9b/37/1a572ec1793fe604c15e4da1e7c2803c14541f19ac755d1303a50786a4fb/hikari_clusters-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ec7bb0b4161e1cfe72f95bb84c1dab0b05410385c21698fff042f09e62235a6b",
"md5": "3fbe25e73b1ca606c5b3f27a0448aa27",
"sha256": "035505b285b4eb83eb64bc1cc3f86ba735be20b6ea42db25e3f82e0c50a5ad30"
},
"downloads": -1,
"filename": "hikari_clusters-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "3fbe25e73b1ca606c5b3f27a0448aa27",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.14,>=3.9",
"size": 16822,
"upload_time": "2024-10-11T01:17:44",
"upload_time_iso_8601": "2024-10-11T01:17:44.312313Z",
"url": "https://files.pythonhosted.org/packages/ec/7b/b0b4161e1cfe72f95bb84c1dab0b05410385c21698fff042f09e62235a6b/hikari_clusters-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-11 01:17:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "TrigonDev",
"github_project": "hikari-clusters",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hikari-clusters"
}