CoAkka Runtime · C#/.NET 3.3.2

Cheat sheet CoAkka Runtime · C#/.NET

Tra nhanh NuGet coordinate, API shape, outcome và lifecycle; mở bài đầy đủ khi cần failure law.

Version và package

Project
<PackageReference Include="CoAkka.Runtime" Version="3.3.2" />
Connector
3.3.2: Core generation 3.3, connector revision 2.
Framework
net8.0 cho bài học.
Native RID assets
macOS ARM64, Linux ARM64/x64, Windows ARM64/x64. Support claim cần exact package + OS + CPU evidence.
Owner
RuntimeHost; dùng await using hoặc DisposeAsync đúng app lifecycle.

Embedded request/reply

C#
await using var runtime = RuntimeHost.StartLocal(
    systemName: "orders",
    target: "orders.quote",
    nodeId: "orders-1");
runtime.RegisterTextHandler("orders.quote", quantity => Quote(quantity));
var reply = await runtime.AskTextAsync(
    source: "checkout",
    target: "orders.quote",
    payload: "2",
    timeoutMs: 2_000);

Mở file chạy đầu tiên.

Outcome và Deadletter

Reply
AskTextAsync, AskAsync trả terminal response đã correlation.
Deadletter
DeadletterException.Deadletter giữ reason, original envelope, generation và delivery failure facts.
Timeout/cancel
Failure boundary riêng; không chứng minh handler chưa chạy.
OneWay
SendOneWay* không chờ business response nhưng vẫn có admission/observability evidence.
Classification
Dùng typed exception, enum và stable numeric code; không parse message text.

Peer trực tiếp

Service
Network = RuntimeNetworkConfig.NetworkNode(
    bindHost: "0.0.0.0",
    bindPort: 19_321,
    advertiseHost: "pricing.internal",
    advertisePort: 19_321)
Caller
Network = RuntimeNetworkConfig.OutboundOnly(),
Routes = [new RuntimeRouteSpec(
    Target: "orders.quote",
    Endpoints: [new RuntimeEndpointSpec("pricing.internal", 19_321, 1)],
    Strategy: RuntimeRouteStrategy.SingleOwner)]

Mở ví dụ hai process.

File Lane và Stream Lane

File sample · Stream sample

Monitor và effective state

EnableMonitor = true
Startup intent.
StartupConfig()
Core accepted Monitor/default facts.
Health() / Stats()
Observed runtime state và counters.
RuntimeConfig()
Generation, routes, state và transport bind facts.
API boundary
C# 3.3.2 chưa chiếu Monitor wait API; không copy method từ connector khác.

Checklist tích hợp

Mở reference cấu hình C#/.NET.