Skip to main content

Module tenancy

Module tenancy 

Source
Expand description

Multi-tenancy support for RingKernel.

This module provides tenant isolation, resource quotas, and tenant-aware operations for multi-tenant deployments.

§Example

use ringkernel_core::tenancy::{TenantContext, TenantRegistry, ResourceQuota};

let registry = TenantRegistry::new()
    .with_tenant("tenant_a", ResourceQuota::new()
        .with_max_kernels(100)
        .with_max_gpu_memory_mb(8192)
        .with_max_messages_per_sec(10000))
    .with_tenant("tenant_b", ResourceQuota::new()
        .with_max_kernels(50)
        .with_max_gpu_memory_mb(4096));

let ctx = TenantContext::new("tenant_a");
if let Some(quota) = registry.get_quota(&ctx.tenant_id) {
    if quota.check_kernel_limit(current_kernels) {
        // Launch kernel
    }
}

Structs§

QuotaUtilization
Quota utilization percentages.
ResourceQuota
Resource quotas for a tenant.
ResourceUsage
Current resource usage for a tenant.
TenantContext
Context for tenant-scoped operations.
TenantRegistry
Registry for managing tenants.

Enums§

TenantError
Error type for tenant operations.

Type Aliases§

TenantResult
Result type for tenant operations.