Table of Contents

Class RemoteLinks

Namespace
Foundation.Data.Doublets.Cli.Protocol
Assembly
Foundation.Data.Doublets.Cli.dll

The established uint remote store using the shared selected-address protocol.

public sealed class RemoteLinks : RemoteLinks<uint>, IDisposable, ITriplets<uint>, INamedTypesLinks<uint>, ILinks<uint>, ILinks<uint, LinksConstants<uint>>, INamedTypes<uint>
Inheritance
RemoteLinks
Implements
ILinks<uint>
ILinks<uint, LinksConstants<uint>>
Inherited Members
Extension Methods

Code written against ITriplets<TLinkAddress>, TripletsQueryProcessor included, switches from a local store to a server by swapping one value. Every call is one TripletsOperation round trip. The doublets that store the triplets stay behind the server: over a server in triplet mode, the doublet calls (Create, Update, Delete, Each) are refused like a failed connection; only Exists, which counts, and the names keep working.

Constructors

Uses an existing connection, which the store then owns.

public RemoteLinks(LinksClient client)

Parameters

client LinksClient

Properties

The markers the server names; one the subject may not read is 0. Nothing else of this implementation depends on them: the server applies the encoding.

public TripletMarkers<uint> Markers { get; }

Property Value

TripletMarkers<uint>

Methods

Connects to a server at an address written as host:port.

public static RemoteLinks Connect(string endPoint, ILinoProtocol protocol)

Parameters

endPoint string
protocol ILinoProtocol

Returns

RemoteLinks

Connects to a server at any IPC endpoint, such as unix:/tmp/links.sock or shm:/tmp/links.

public static RemoteLinks ConnectEndpoint(string endpoint, ILinoProtocol protocol)

Parameters

endpoint string
protocol ILinoProtocol

Returns

RemoteLinks

The number of triplets that match query.

public int CountTriplets(TripletQuery<uint> query)

Parameters

query TripletQuery<uint>

Returns

int

Number of triplets matching restriction.

public uint CountTripletsMatching(LinksRestriction restriction)

Parameters

restriction LinksRestriction

Returns

uint

Creates (i: type from to) and returns i. type must be a triplet; from and to triplets or the null link.

public uint CreateTriplet(uint type, uint from, uint to)

Parameters

type uint
from uint
to uint

Returns

uint

Creates a triplet (i: i 0 0) that is its own type.

public uint CreateTripletPoint()

Returns

uint

Makes the free address address a point: create has no way to name an address, a substitution query does.

public void CreateTripletPointAt(uint address)

Parameters

address uint

Deletes the triplet at index and every triplet that uses a deleted one as its type, from or to; returns them all, index first.

public IReadOnlyList<Triplet<uint>> DeleteTriplet(uint index)

Parameters

index uint

Returns

IReadOnlyList<Triplet<uint>>

How many other triplets use id: the doublets behind them are not on the wire.

public int DoubletUsages(uint id)

Parameters

id uint

Returns

int

The triplets that match query, in the order of their addresses.

public IReadOnlyList<Triplet<uint>> EachTriplet(TripletQuery<uint> query)

Parameters

query TripletQuery<uint>

Returns

IReadOnlyList<Triplet<uint>>

Runs an established uint operation and returns its reply.

public IReadOnlyList<Link<string>> Execute(LinksOperation operation)

Parameters

operation LinksOperation

Returns

IReadOnlyList<Link<string>>

Runs one triplet operation on the server and returns its reply.

public IReadOnlyList<Link<string>> ExecuteTriplets(TripletsOperation operation)

Parameters

operation TripletsOperation

Returns

IReadOnlyList<Link<string>>

The triplet at index, null when it is not a triplet.

public Triplet<uint>? GetTriplet(uint index)

Parameters

index uint

Returns

Triplet<uint>?

Whether index is a triplet.

public bool IsTriplet(uint index)

Parameters

index uint

Returns

bool

The next change pushed for a subscription of this store, waiting up to timeout for one; null when none arrived in time.

public LinksNotification? ReceiveNotification(TimeSpan timeout)

Parameters

timeout TimeSpan

Returns

LinksNotification

The next change pushed to a subscription of this connection, waiting up to timeout for one; null when none arrived in time.

public TripletsNotification? ReceiveTripletNotification(TimeSpan timeout)

Parameters

timeout TimeSpan

Returns

TripletsNotification

A marker, a triplet, or null: the doublets that store the triplets are not on the wire, so they read as missing.

public DoubletRole? RoleOf(uint id)

Parameters

id uint

Returns

DoubletRole?

Asks the server to push the changes other connections make to the links matching restriction and returns the number of the subscription, which ReceiveNotification(TimeSpan) reports with them.

public uint Subscribe(LinksRestriction restriction)

Parameters

restriction LinksRestriction

Returns

uint

Asks the server to push the changes other connections make to the triplets matching restriction and returns the number of the subscription, which ReceiveTripletNotification(TimeSpan) reports them with. Unsubscribe(uint) stops it.

public uint SubscribeTriplets(LinksRestriction restriction)

Parameters

restriction LinksRestriction

Returns

uint

Runs a create, update or delete and returns its changes.

public IReadOnlyList<TripletChange<uint>> TripletChanges(TripletsOperation operation)

Parameters

operation TripletsOperation

Returns

IReadOnlyList<TripletChange<uint>>

Triplets matching restriction, ordered by index.

public IReadOnlyList<Triplet<uint>> TripletsMatching(LinksRestriction restriction)

Parameters

restriction LinksRestriction

Returns

IReadOnlyList<Triplet<uint>>

Stops a subscription; changes already pushed for it are still received.

public void Unsubscribe(uint subscription)

Parameters

subscription uint

Makes the triplet at index (index: type from to), keeping its address, and returns the triplet as it was. The pair it no longer uses is collected when nothing else uses it.

public Triplet<uint> UpdateTriplet(uint index, uint type, uint from, uint to)

Parameters

index uint
type uint
from uint
to uint

Returns

Triplet<uint>