Skip to content

Tylerlog/hagworm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hagworm

快速开始

1. 下载

git clone git@github.com:wsb310/hagworm.git

2. 安装

pip install hagworm

3. 代码树结构

├── extend                                      package     基础扩展
│   ├── asyncio                                 package     asyncio扩展
│   │   ├── base.py
│   │   ├── cache.py
│   │   ├── database.py
│   │   ├── event.py
│   │   ├── file.py
│   │   ├── future.py
│   │   └── net.py
│   ├── base.py
│   ├── compile.py
│   ├── crypto.py
│   ├── event.py
│   ├── excel.py
│   ├── interface.py
│   ├── metaclass.py
│   └── struct.py
├── frame                                       package     三方框架扩展
│   └── tornado
│       ├── base.py
│       ├── cache.py
│       ├── future.py
│       ├── template.py
│       └── web.py
└── static                                      package     静态资源

4. 重要提示

  • 不要在非异步魔术方法中调用异步函数,例如在__del__中调用异步函数,在该函数结束前,对象一直处于析构中的状态,此时弱引用是有效的,但如果此时另外一个线程或者协程通过弱引用去使用它,然后意外就可能发生了
  • 使用contextvars库时,要注意使用asyncio的call_soon、call_soon_threadsafe、call_later和call_at函数时(建议使用hagworm.extend.asyncio.base.Utils提供的函数),其中的context参数,必须给出独立的contextvars.Context对象,使其上下文环境独立,否则会出现伪内存泄漏现象

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.9%
  • Other 1.1%