semvec/pypi-packages huggingface dataset:
raddish 0.2.4
Async-native Redis-backed RPC and job queue
License: Apache-2.0
Requires Python: >=3.10,<4.0

# Raddish

Raddish is mix of RPC and job queue backed by Redis. You can launch multiple servers that will accept the same function calls in a round-robin fashion. From the client side you can asynchronously submit jobs and block the execution until they are completed.

---
# Getting started

1. Implement a server
```python
import asyncio
import logging
import os

from redis.asyncio import Redis
from rich.logging import RichHandler

from raddish import RaddishServer, AsyncWorker

logging.basicConfig(
    level=logging.INFO,
    format="%(message)s",
    datefmt="[%X]",
    handlers=[RichHandler(rich_tracebacks=True)],
)

logger = logging.getLogger("raddish-test")


class TestWorker(AsyncWorker):
    async def setup(self) -> None:
        logger.info("Setting up test worker")

    async def __call__(self, input: dict[str, any]) -> dict[str, any]:
        logger.info(f"Received input: {input}")
        input: int = input["number"]
        input += 1
        await asyncio.sleep(10)
        return {
            "number": input,
        }


async def main() -> None:
    redis_client: Redis = Redis.from_url(
        os.environ.get("REDIS_URL", "redis://localhost:6379")
    )
    server: RaddishServer = RaddishServer(redis_client)
    server.add_worker("add_one", TestWorker())
    await server.start()


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

```

2. Implement a client
```python
import asyncio
import logging
import os

from redis.asyncio import Redis
from rich.logging import RichHandler

from raddish import AsyncRaddishClient

logging.basicConfig(
    level=logging.INFO,
    format="%(message)s",
    datefmt="[%X]",
    handlers=[RichHandler(rich_tracebacks=True)],
)

logger = logging.getLogger("raddish-test")


async def main() -> None:
    redis_client: Redis = Redis.from_url(
        os.environ.get("REDIS_URL", "redis://localhost:6379")
    )
    client: AsyncRaddishClient = AsyncRaddishClient(redis_client)

    counter: int = 0
    for _ in range(5):
        logger.info(f"Sending input {counter}")
        counter = (await client.call("add_one", {"number": counter}))["number"]
        logger.info(f"Received output {counter}")


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

```

3. Launch one or more servers
```bash
python server.py
```

4. Launch one or more clients
```bash
python client.py
```

---
# Features

* You can add servers at any time in order to increase capacity
* Asyncio-native
* Servers can be located anywhere where there is internet, no need to have public ip - you only need to be able to connect to the redis server


---
# License

Raddish is licensed under Apache License, Version 2.0
cdk-cloudformation-poc-azure-blobstorage 1.1.0a7
An example resource that creates an Azure Storage account along with a Blob container.
License: Apache-2.0
Requires Python: ~=3.7

# poc-azure-blobstorage

> AWS CDK [L1 construct](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html) and data structures for the [AWS CloudFormation Registry](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html) type `POC::Azure::BlobStorage` v1.1.0.

## Description

An example resource that creates an Azure Storage account along with a Blob container.

## Usage

In order to use this library, you will need to activate this AWS CloudFormation Registry type in your account. You can do this via the AWS Management Console or using the [AWS CLI](https://aws.amazon.com/cli/) using the following command:

```sh
aws cloudformation activate-type \
  --type-name POC::Azure::BlobStorage \
  --publisher-id fbafc40f22913f42efb711903e40c701642af7ee \
  --type RESOURCE \
  --execution-role-arn ROLE-ARN
```

Alternatively:

```sh
aws cloudformation activate-type \
  --public-type-arn arn:aws:cloudformation:us-east-1::type/resource/fbafc40f22913f42efb711903e40c701642af7ee/POC-Azure-BlobStorage \
  --execution-role-arn ROLE-ARN
```

You can find more information about activating this type in the [AWS CloudFormation documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-public.html).

## Feedback

This library is auto-generated and published to all supported programming languages by the [cdklabs/cdk-cloudformation](https://github.com/cdklabs/cdk-cloudformation) project based on the API schema published for `POC::Azure::BlobStorage`.

* Issues related to this generated library should be [reported here](https://github.com/cdklabs/cdk-cloudformation/issues/new?title=Issue+with+%40cdk-cloudformation%2Fpoc-azure-blobstorage+v1.1.0).
* Issues related to `POC::Azure::BlobStorage` should be reported to the [publisher](undefined).

## License

Distributed under the Apache-2.0 License.