Skip to main content

simple tools

Project description

Desc

Tools for creating asynchronous scripts easily.

keywords: tools,asyncio

Feature

  • Task pool
  • Actor and Actor Manager

Example

async with AioFixedTaskPoolSimple() as task_pool:
    print(f"test pool size {task_pool.size}")
    print("test 4 task with pool size 3")
    await asyncio.gather(
        task_pool.submit(test, func_args=["c"]),
        task_pool.submit(test, func_args=["b"]),
        task_pool.submit(test, func_args=["a"]),
        task_pool.submit(test, func_args=["d"])
    )

class Pinger(AioActor):
    async def receive(self, message):
        print(message)
        try:
            await ActorManager.get_actor("Ponger").Send('ping')
        except Exception as e:
            print(f"receive run error {e}")
        finally:
            await asyncio.sleep(0.5)

Install

  • python -m pip install aio_parallel_tools

Change Log

version 0.0.1

  • created this project

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aio_parallel_tools, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size aio_parallel_tools-0.0.1-py3-none-any.whl (37.8 kB) File type Wheel Python version 3.7 Upload date Hashes View hashes
Filename, size aio_parallel_tools-0.0.1.tar.gz (17.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page