Skip to main content

Polyglot RPC over Redis — call functions across languages

Project description

Python - AnyCall

This directory contains the Python components of the AnyCall project. Call functions across Python services using Redis, with no .proto files, exposed ports, or extra service plumbing to maintain.

Structure

  • lib/ - AnyCall core library
  • example-consumer/ - Consumer example
  • example-supplier/ - Supplier example
  • Dockerfile - Docker image for the project
  • pyproject.toml - uv workspace configuration
  • rebuild-all.sh - Script to rebuild all modules

How to use

Build

./rebuild-all.sh

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 and writes a health file to /tmp/anycall/health.

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

anycall_py-0.1.2.tar.gz (9.3 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.1.2-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anycall_py-0.1.2.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for anycall_py-0.1.2.tar.gz
Algorithm Hash digest
SHA256 84da0de75edfff2b3e9a184dc6c119f7d9f47a8a6572fa097b2fa7c1b2815335
MD5 08b084e4e4e343dde73bd69b981bcf9e
BLAKE2b-256 a06c2248fe11c0061b0155f5e51e7028021fb370b31c9979d95e62cbd4d50fa2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anycall_py-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for anycall_py-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7221f9f926bb088f7caa665bb21788f8e1afd5278d49afdd1278bc5c14ae2d53
MD5 6e5e956c6718f190bfbb57410405719d
BLAKE2b-256 cb7db56aef0306dce3e0f5ba14a78d25e658c355dfda5db6635ec2c8ce98f357

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