Skip to main content

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 AnyCall client 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 @supply decorator 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.

Download files

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

Source Distribution

anycall_py-0.4.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

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

anycall_py-0.4.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file anycall_py-0.4.0.tar.gz.

File metadata

  • Download URL: anycall_py-0.4.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.21

File hashes

Hashes for anycall_py-0.4.0.tar.gz
Algorithm Hash digest
SHA256 26863baf599d1805948065f40268ee4b212809831f061381905a53a8b6dacdfc
MD5 51c786d987243f295b7f9b9aa6af7a51
BLAKE2b-256 3e421689cbb0f5330a5512d41f3efaa915fc2785d1563f317c9d045bd65f62b4

See more details on using hashes here.

File details

Details for the file anycall_py-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: anycall_py-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.21

File hashes

Hashes for anycall_py-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c759aa6e65e833e04473016ab8a73d503e333492c1693e3bd77dfc1444e32a3
MD5 c7220e837fffc81a201fa36fd110432f
BLAKE2b-256 81683b120bdd943a61db16ca4505f391784d5cd70245ecc17361a89fd45bf4d7

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

1 file

0.1.0

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page