PostgreSQL · Types · Routing, paging cookies and capabilities

IArxRouter

Definition

Namespace
ARX.SDK.Services
Package
ARX.SDK
C#
public interface IArxRouter<TService>

Sends a call to the right service for a route key: a tenant, a region, a database. One service per key, made on first use and kept, so the router is a singleton like the services it holds. There is no mutable "current tenant": each call asks the router for its own key, so concurrent requests never see each other's.

Properties

  • IReadOnlyCollection<string> RouteKeys { get; }

    Every declared route key.

Methods

  • TService For(string routeKey)

    The service for this key. An unknown key is ARX1001 InvalidArgument (the message doesn't echo the key).

    Parameter Type Description
    routeKeystringThe key that picks the service: a tenant, a region, a shard.
  • bool TryFor(string routeKey, out TService service)

    The service for this key, or false when no route is declared for it.

    Parameter Type Description
    routeKeystringThe key that picks the service: a tenant, a region, a shard.
    serviceout TServiceThe service when the key has a route; otherwise the default.