# 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`)
<p align="center">
<img src="https://us-east-1.tixte.net/uploads/files.circuitsacul.dev/hikari-clusters-diagram.jpg">
</p>
## 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": "",
"docs_url": null,
"requires_python": ">=3.8.0,<3.12",
"maintainer_email": "",
"keywords": "hikari,discord,clustering,bot,ipc",
"author": "Circuit",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/03/4e/931a4814ef649740a108f5e3daf6e8f1dd53aa733ebe86d302129743e497/hikari_clusters-1.1.4.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<p align=\"center\">\n <img src=\"https://us-east-1.tixte.net/uploads/files.circuitsacul.dev/hikari-clusters-diagram.jpg\">\n</p>\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.1.4",
"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": "18669387a2b5baf70bc9c05851a80c5a18b81f50b2d43ff641a8b47bd69e3134",
"md5": "ca143611b224264ca1bfb17626bc62c2",
"sha256": "14a8fe70231292708de1a38f47995bb53943fd25683ede8d2ca45b8360d21480"
},
"downloads": -1,
"filename": "hikari_clusters-1.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ca143611b224264ca1bfb17626bc62c2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.0,<3.12",
"size": 24396,
"upload_time": "2023-06-19T16:28:41",
"upload_time_iso_8601": "2023-06-19T16:28:41.155361Z",
"url": "https://files.pythonhosted.org/packages/18/66/9387a2b5baf70bc9c05851a80c5a18b81f50b2d43ff641a8b47bd69e3134/hikari_clusters-1.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "034e931a4814ef649740a108f5e3daf6e8f1dd53aa733ebe86d302129743e497",
"md5": "0ccfdd6a1d3d1345102209cdcc7d6d78",
"sha256": "ff6bd9797a5c733da4ca9c37a16dc30a91fbc0e2aa22b07b974074cf64b0790f"
},
"downloads": -1,
"filename": "hikari_clusters-1.1.4.tar.gz",
"has_sig": false,
"md5_digest": "0ccfdd6a1d3d1345102209cdcc7d6d78",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.0,<3.12",
"size": 17048,
"upload_time": "2023-06-19T16:28:43",
"upload_time_iso_8601": "2023-06-19T16:28:43.411123Z",
"url": "https://files.pythonhosted.org/packages/03/4e/931a4814ef649740a108f5e3daf6e8f1dd53aa733ebe86d302129743e497/hikari_clusters-1.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-19 16:28:43",
"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"
}