Skip to main content

A python server to support communication between CRM and Component processes.

Project description

C-Two (0.1.19)

C-Two (CC) is a type-safe RPC framework designed for distributed resource computation. It provides a seamless abstraction layer between client components and remote Core Resource Models (CRM), enabling transparent remote procedure calls with automatic serialization and multi-protocol support.

Key Features

  • 🔧 Decorator-Driven Interface: Define and implement remote interfaces using @icrm and @iicrm decorators
  • 🔒 Type Safety: Full type annotation support with automatic type checking and inference
  • ⚡ Auto-Transfer: Intelligent serialization based on function signatures and type hints
  • 🔄 Transparent Proxying: Call remote methods as if they were local functions
  • 📡 Connection Management: Flexible connection handling with context management

Architecture

The framework implements a three-layer architecture separating concerns between client components, resource models, and transport protocols:

Architecture

Component Layer

Client-side components that consume remote resources through ICRM interfaces, providing a clean abstraction over network complexity.

CRM Layer

Core Resource Models implementing the actual business logic and resource management, exposed through standardized interfaces.

Transport Layer

Protocol-agnostic communication layer supporting multiple transport mechanisms (ZMQ, gRPC, MCP) with automatic load balancing and connection pooling.

Quick Start

1. Define an Interface

import c_two as cc

@cc.icrm
class IGrid:
    def get_grid_infos(self) -> list[GridAttribute]:
        """Get grid information from remote resource"""
        ...

2. Implement the Resource Model

@cc.iicrm
class Grid(IGrid):
    @cc.auto_transfer
    def get_grid_infos(self) -> list[GridAttribute]:
        # Actual implementation with automatic serialization
        return [GridAttribute(id=1, name="grid1")]

3. Connect and Use

# Client side - transparent remote calls
with cc.connect_crm("tcp://localhost:5555", IGrid) as grid:
    infos = grid.get_grid_infos()  # Seamless remote call
    print(f"Received {len(infos)} grid attributes")

Use Cases

C-Two is particularly well-suited for:

  • Distributed Computing: Resource-intensive computations across multiple machines
  • Microservices Architecture: Type-safe inter-service communication
  • Scientific Computing: High-performance data processing
  • Real-time Systems: Low-latency remote procedure calls with connection pooling

C-Two bridges the gap between local and remote computing, making distributed systems feel as natural as local function calls.

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

c_two-0.1.19.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

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

c_two-0.1.19-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file c_two-0.1.19.tar.gz.

File metadata

  • Download URL: c_two-0.1.19.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for c_two-0.1.19.tar.gz
Algorithm Hash digest
SHA256 144afad7201b124ffc2fab3a033e0bf2b1315d50d18345154aa2b02af0b350ed
MD5 fdc20c0da616171cb8203704465195ef
BLAKE2b-256 3df2b88c8824d2e7e447aaac2b84ef7b71308bfb653922522618027ed33756bf

See more details on using hashes here.

File details

Details for the file c_two-0.1.19-py3-none-any.whl.

File metadata

  • Download URL: c_two-0.1.19-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for c_two-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 fec0f3d87993d090f8851800d2f103e89154241b0cf8da0f19c0a335875569aa
MD5 d51842e564a36448da557479857a39c0
BLAKE2b-256 ccbe472565a47627d4f63bbd3d53edd91ff67caf534025699d2ad86cf181a246

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