一个用于程序实例控制和管理的Python包
Project description
Instancer
一个用于程序实例控制和管理的Python包。
功能特性
- 🎯 客户端装饰器: 通过简单的装饰器设置程序ID和服务地址
- 🖥️ 服务端管理: 提供Web界面进行实例管理
- 📊 实时控制: 动态控制实例数量和状态
- 🚫 强制退出: 支持实时禁用和强制退出正在运行的实例
- 🔧 简易部署: 一键启动服务端
快速开始
安装
pip install instancer
客户端使用
from instancer import instance_control
@instance_control(program_id="my_app", server_url="http://localhost:5000")
def my_application():
print("应用程序正在运行...")
# 您的应用逻辑
if __name__ == "__main__":
my_application()
服务端部署
# 启动服务端
instancer-server --host 0.0.0.0 --port 5000
# 或者在Python中启动
python -m instancer.server
管理界面
访问 http://localhost:5000 打开管理界面,可以:
- 添加和配置程序ID
- 设置允许的实例数量
- 实时查看运行状态
- 禁用/启用程序
配置说明
客户端配置
program_id: 程序的唯一标识符server_url: 服务端地址check_interval: 状态检查间隔(秒,默认5秒)
服务端配置
host: 服务绑定地址(默认127.0.0.1)port: 服务端口(默认5000)database_url: 数据库连接字符串(默认SQLite)
许可证
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
instancer-1.0.0.tar.gz
(18.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
instancer-1.0.0-py3-none-any.whl
(19.6 kB
view details)
File details
Details for the file instancer-1.0.0.tar.gz.
File metadata
- Download URL: instancer-1.0.0.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7e496fa5ebb3f4e4894b631c4450e0910e76776cc54f8cbc90e1d7d992bfa62
|
|
| MD5 |
7fbafa0aa386ce2c96f920cef5bc533d
|
|
| BLAKE2b-256 |
74f744ff65281085b7d1b35d9903f2a1eb8225a23cd50360346e5d7ef50f09dc
|
File details
Details for the file instancer-1.0.0-py3-none-any.whl.
File metadata
- Download URL: instancer-1.0.0-py3-none-any.whl
- Upload date:
- Size: 19.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f00315e37035ff458f7083197180ae60284e7747f946aad72be325e73718188
|
|
| MD5 |
4dbd2b8725ae5553d44eb75d5cc8d6b8
|
|
| BLAKE2b-256 |
b2a1394f23fdc75112c67315b23bd18862aba3cc43bfadf3814d4c6a0dcda665
|