aiomothr-0.3.0
توضیحات
Asynchronous client library for interacting with MOTHR
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | aiomothr-0.3.0 |
| نام | aiomothr |
| نسخه کتابخانه | 0.3.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | James Arnold |
| ایمیل نویسنده | james@rs21.io |
| آدرس صفحه اصلی | https://github.com/rs21io/aiomothr |
| آدرس اینترنتی | https://pypi.org/project/aiomothr/ |
| مجوز | - |
# aiomothr


[](https://codecov.io/gh/rs21io/aiomothr)
## Installation
`pip install aiomothr`
## Usage
Basic example submitting a job request
```python
from aiomothr import AsyncJobRequest
request = AsyncJobRequest(service="echo")
request.add_parameter(value="Hello MOTHR!")
result = await request.run_job()
print(result)
```
Submitting a job request Using `AsyncMothrClient`. This allows you to reuse the
client connection when making multiple requests.
```python
from mothrpy import AsyncJobRequest, AsyncMothrClient
client = AsyncMothrClient()
# Send one request
request = AsyncJobRequest(client=client, service="echo")
request.add_parameter(value="Hello MOTHR!")
result = await request.run_job()
print(result)
# Reuse the client in another request
request = AsyncJobRequest(client=client, service="echo")
request.add_parameter(value="Hello again MOTHR!")
result = await request.run_job()
print(result)
```
Submit concurrent job requests
```python
import asyncio
from mothrpy import AsyncJobRequest, AsyncMothrClient
client = AsyncMothrClient()
request_a = AsyncJobRequest(client=client, service="echo")
request_a.add_parameter(value="Hello MOTHR!")
request_b = AsyncJobRequest(client=client, service="echo")
request_b.add_parameter(value="Hello again MOTHR!")
# Execute both requests concurrently
tasks = [request_a.run_job(), request_b.run_job()]
results = await asyncio.gather(*tasks)
for result in results:
print(result)
```
نیازمندی
| مقدار | نام |
|---|---|
| ==3.0.0a4 | gql[aiohttp,websockets] |
| - | asynctest |
| - | pytest |
| - | pytest-asyncio |
| - | pytest-cov |
| - | pytest-mypy |
| - | pytest-pylint |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl aiomothr-0.3.0:
pip install aiomothr-0.3.0.whl
نصب پکیج tar.gz aiomothr-0.3.0:
pip install aiomothr-0.3.0.tar.gz