-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
106e7ac
commit 206f3b9
Showing
5 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.idea | ||
__pycache__ | ||
__pycache__ | ||
dist | ||
roc_py.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Hyperf 多路复用 RPC 组件 Python 版本 | ||
|
||
## 如何使用 | ||
|
||
```python | ||
import asyncio | ||
|
||
from roc.request import Request | ||
from roc.socket import Client | ||
|
||
|
||
async def main(): | ||
client = Client(host="127.0.0.1", port=9502) | ||
while True: | ||
req = Request(path="/test/test", | ||
params={"mobile": "123123", "data": "HelloWorld"}) | ||
res = await client.request(req) | ||
print(res.result) | ||
await asyncio.sleep(1) | ||
|
||
|
||
if __name__ == '__main__': | ||
asyncio.run(main()) | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from roc.request import Request | ||
from roc.socket import Client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import setuptools | ||
|
||
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
setuptools.setup( | ||
# 包的分发名称,使用字母、数字、_、- | ||
name="roc-py", | ||
# 版本号, 版本号规范:https://www.python.org/dev/peps/pep-0440/ | ||
version="0.1.0", | ||
# 作者名 | ||
author="limingxinleo", | ||
# 作者邮箱 | ||
author_email="[email protected]", | ||
# 包的简介描述 | ||
description="Hyperf 多路复用 RPC 组件 Python 版本", | ||
# 包的详细介绍(一般通过加载README.md) | ||
long_description=long_description, | ||
# 和上条命令配合使用,声明加载的是markdown文件 | ||
long_description_content_type="text/markdown", | ||
# 项目开源地址 | ||
url="https://github.com/hyperf/roc-py", | ||
# 如果项目由多个文件组成,我们可以使用find_packages()自动发现所有包和子包,而不是手动列出每个包,在这种情况下,包列表将是example_pkg | ||
packages=setuptools.find_packages(), | ||
# 关于包的其他元数据(metadata) | ||
classifiers=[ | ||
# 该软件包仅与Python3兼容 | ||
"Programming Language :: Python :: 3", | ||
# 根据MIT许可证开源 | ||
"License :: OSI Approved :: MIT License", | ||
# 与操作系统无关 | ||
"Operating System :: OS Independent", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ async def main(): | |
await asyncio.sleep(1) | ||
|
||
|
||
asyncio.run(main()) | ||
if __name__ == '__main__': | ||
asyncio.run(main()) |