Python - AnyCall (core library)
This directory contains the AnyCall core library for Python (published as
anycall-py). Call functions across Python services using Redis, with no
.proto files, exposed ports, or extra service plumbing to maintain.
../example-consumer/ and
../example-supplier/.
Structure
- src/anycall/ - AnyCall core library package
- pyproject.toml - Package metadata and dependencies
- TESTING.md - How to run the test suite
How to use
Install
# Using uv (recommended)
uv sync
# Or using pip
pip install -e .
Quick usage
- Supplier: decorate methods with
@supply, register the class, and start the server. - Consumer: create an
AnyCallclient and call the supplier method by name.
server = AnyCall.server(redis_uri)
server.register(SentimentAnalyzer())
server.start()
client = AnyCall.client(redis_uri)
sentiment = client.call("analyze-sentiment", request, Sentiment)
For details on how to use as a supplier or consumer, see USAGE.md.
Modules
lib
Core library implementing an RPC framework via Redis Streams. Uses the AnyCall factory class to create clients and servers:
-
AnyCall Client: Synchronous interface for invoking remote methods. Serializes the request to JSON, publishes to a Redis Stream, waits for the response on a callback stream. Supports configurable timeout and optional metrics collection.
-
AnyCall Server: Listener that processes requests from Redis. Maintains a thread pool (one per registered method) consuming from specific streams. Methods are discovered via the
@supplydecorator on registered classes. -
Configuration: Via
AnycallProperties— defines parameters like Redis URI, timeouts, thread pools, etc.
example-consumer
Client application demonstrating the use of AnyCallClient. Makes 100 RPC calls to the analyze-sentiment method and displays latency statistics (min, avg, p50, p95, p99, max). Includes warmup call and metrics support.
example-supplier
Server application that registers suppliers via AnyCall.server(). The SentimentAnalyzer class contains an analyze_sentiment method decorated with @supply("analyze-sentiment"), which handles sentiment analysis. Starts listeners for each registered method.
Release files for anycall-py 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| anycall_py-0.5.0.tar.gz | 16.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| anycall_py-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.7 kB
Release files / anycall_py-0.5.0.tar.gz
| Download URL | anycall_py-0.5.0.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad07c326f891b069dce102e6fdc35020895c3f77247a8862c4982d5e883b6a2f
|
|
BLAKE2b-256 checksum How to use checksums |
2ef065be2b36511987ebbd62db6aa36441861cad38d4696282854bd1fafa1f65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / anycall_py-0.5.0-py3-none-any.whl
| Download URL | anycall_py-0.5.0-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
22fcb341b38aa2d56dcc05a19c0f182716e1b41c14252b13edafc2b64fcd296a
|
|
BLAKE2b-256 checksum How to use checksums |
67118dc545482cb2972621b3c0befca81267a641b56a43db6d60994730bac72c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|