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.2.0.tar.gz (16.6 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.2.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for anycall_py-0.2.0.tar.gz
Algorithm Hash digest
SHA256 04e402caebb879c242ceb9081d390cb98da3fff4df4a8568c472d8db584fe3f8
MD5 87a091a4586f9faafe72bc2d79535dde
BLAKE2b-256 6c13b501840fb2fde6d5edd46ebfa4cd63ef42c35827c29beabb45b9d58b065e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for anycall_py-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2dfdee28b2f5ed19fa2856f4684e0e52a9aee9eb48354c1c0b8ff0961bdcd33a
MD5 e093e556a471c8c477ed03153865cb1d
BLAKE2b-256 f47e66d888a9a3609711b0866c18bc94f0b69d66e70212a54e391e2ebf5d11a7

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.0

2 files

0.3.0

2 files

This release

0.2.0 This release

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