fasttask's manager
Project description
fasttask_manager
Manager for fasttask
Installation
pip install fasttask_manager
Usage
Create a Manager
Synchronous Manager:
from fasttask_manager import Manager
m = Manager("127.0.0.1", port=8080)
Asynchronous Manager:
import asyncio
from fasttask_manager import AsyncManager
async def main():
am = AsyncManager("127.0.0.1", port=8080)
# use await
result = await am.run(params)
Run a task
result = m.run(params)
Create a task and check result later
result_id = m.create_task(params)
# do something...
result = m.check(result_id)
Create a task and wait for result
result = m.create_and_wait_result(params)
Upload a file
file_name = m.upload("/path/to/file.txt")
Download a file
m.download("file.txt", "/path/to/save.txt")
Revoke a task
m.revoke(result_id)
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
| host | str | - | Server host |
| protocol | str | "http" | HTTP protocol |
| port | int | 80 | Server port |
| tries | int | 5 | Max retry attempts |
| delay | int | 3 | Retry delay (seconds) |
| logger | Logger | None | Custom logger |
| log_prefix | str | "" | Log prefix |
| auth_user | str | "" | Basic auth username |
| auth_passwd | str | "" | Basic auth password |
| url_base_path | str | "" | URL base path |
| req_timeout | int | 30 | Request timeout (seconds) |
| simple_error_log | bool | True | Simple error logging |
| verify_ssl | bool | False | Verify SSL certificate |
Architecture
BaseManager (shared initialization and utilities)
├── Manager (synchronous implementation)
│ ├── _req: uses requests library
│ └── _wait: uses time.sleep
└── AsyncManager (asynchronous implementation)
├── _req: uses httpx async client
└── _wait: uses asyncio.sleep
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
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
File details
Details for the file fasttask_manager-0.5.0.tar.gz.
File metadata
- Download URL: fasttask_manager-0.5.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83a2eb4e771d1924d903948f2e9777ae9ad44d1c8e5eb278d4c4ad377bd99edc
|
|
| MD5 |
2467823e3017daafbc610ec4fa2f5a28
|
|
| BLAKE2b-256 |
b9ab470e9ded4142c58dd9894b9aa8786fd9b56cbb6183ff73b4c0e4d10cf80f
|
File details
Details for the file fasttask_manager-0.5.0-py3-none-any.whl.
File metadata
- Download URL: fasttask_manager-0.5.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35bc23ff802fb2e9307d07d59678ba69696dead60a4b69e003c54b6e9872a773
|
|
| MD5 |
265cbb36fd135f61b4f6571bc306015f
|
|
| BLAKE2b-256 |
c3f6582ae3a96d1ebbd0a82c23b58d572d41c90b4600a0f27d062bd0ffbc0272
|