Skip to main content

A fast asynchronous coroutine executor for asynchronous programming and fast I/O.

Project description

fasio

A Truly Asynchronous Library for Coroutine Scheduling


Overview

fasio is an advanced asynchronous I/O library designed to simplify the development of high-performance network applications. It leverages the power of coroutines to provide a truly asynchronous programming model, allowing you to manage tasks efficiently without blocking operations. With fasio, you can create responsive applications that scale effortlessly.

Key Features

  • Truly Asynchronous: Supports async-await syntax for writing non-blocking code, allowing for efficient I/O operations.
  • Robust Event Loop: A fast and reliable event loop for managing asynchronous tasks and socket operations.
  • Cross-Thread Notifications: Built-in mechanisms for receiving notifications from other threads and processes.
  • Easy Socket Handling: Simplifies asynchronous socket programming, making it easy to build servers and clients.
  • Modular Design: Designed to integrate seamlessly into existing applications, enhancing functionality without major refactoring.

Installation

To install fasio, use pip:

pip install fasio

Usage

fasio is designed for ease of use. Below is a simple example of how to create a basic TCP echo server using fasio's features.

Example: Asynchronous TCP Echo Server

from fasio import start, spawn, socket

async def handle_client(client):
    while True:
        data = await client.recv(100)

        if not data:
            break

        await client.send(data)

async def main():
    serverfd = socket(socket.AF_INET, socket.SOCK_STREAM)
    serverfd.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR)
    serverfd.bind(('localhost', 8080))
    serverfd.listen(socket.SOMAXCONN)

    while True:
        client, addr = await serverfd.accept()

        spawn(handle_client(client))

start(main())

Explanation

In this example, we create a TCP server that listens on localhost at port 8080. When a client connects, a new coroutine is spawned to handle the client’s requests. The server echoes back any data received, demonstrating fasio's capabilities for handling asynchronous socket operations.


Contributing

Contributions to fasio are welcome! If you’d like to help improve the library, please fork the repository and submit a pull request. Feel free to report issues or request features through the issue tracker.

How to Contribute

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them with clear messages.
  4. Push your branch and submit a pull request.

License

fasio is released under the MIT License. See the LICENSE file for more details.


Contact

For any questions or feedback, please reach out via iadityanath8@gmail.com.


With fasio, harness the power of asynchronous programming to create efficient, high-performance applications. Start building today and explore the possibilities!

Project details


Download files

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

Source Distribution

fasio-0.2.0.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fasio-0.2.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file fasio-0.2.0.tar.gz.

File metadata

  • Download URL: fasio-0.2.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for fasio-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0e94fdd8fc0a1231fba42e59613de317771d006457d94be42abcefca83c25c75
MD5 ffd490f08ad78ba8fef5e68e76a46405
BLAKE2b-256 92cd8e7595a786aa6054a9d943cdf09cf5a9995e45f9d0557741a368283ef002

See more details on using hashes here.

File details

Details for the file fasio-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fasio-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for fasio-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9986f44d6d0fb92122f8ad866cf6d8e6e7d04f1d1637867dd4a085246740ff0
MD5 41e9d9c5d6ba793de22eb49c3fecd4ee
BLAKE2b-256 9e8755a00b460669e80d270b80f62c6e37570cd7308ab394d8758cbd05c3aaa3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page