Logo Orsak

Orsak.Remoting Namespace

Type/Module Description

Conformance

Checks an IWireEncoding: that the values of every kind of type WireMapping supports cross it and come back the same, and that two encodings of a content type read what the other writes. Each check returns its failures, empty if it passes, for a test of any framework to assert on.

Frame

A frame of a streamed response: an item, the end of the stream, or its failure on the server.

Frames

The frames of a streamed response: a byte of their kind, the length of their content, as 4 bytes, the most significant first, and the content. An item's content is the item, written by the member's format; a failure's is a message, in UTF-8. The end has none, so a response cut short is told from one that ended.

GenRemoteAttribute

Generates, with Orsak.Myriad, a proxy for the interface: a class implementing it by calling a RemoteClient, named after the interface without its leading I, with Proxy, such as OrderApiProxy for IOrderApi.

HttpClientTransport

Sends with an HttpClient. Credentials, such as a bearer token, go in its default headers, or in a handler of its own, which can ask for a token on each request.

IRemoteBody

The body of a response, read as it comes, in chunks, such as a stream's frames.

IRemoteTransport

Sends a request and returns the body of a successful response, raising RemoteCallException otherwise, or OperationCanceledException once the token is cancelled, which aborts the request.

IWireArgumentsCodec

Writes the arguments of one member to the wire, and reads them back, in one format.

IWireCodec

Writes the values of one type to the wire, and reads them back, in one format.

IWireEncoding

The bytes of a self-describing format: WireValues to bytes and back. Given to a WireFormat, it is a format a client and a server can use, with the values of F# types mapped as for every other encoding.

IWireFormat

How values cross the wire: what a remote call's arguments and result are written as, and read from. JSON is one; a binary format, such as MessagePack, would be another.

Json

Writes and parses JSON text, in plain F#, so .NET and Fable read and write it the same way. Bytes are a base64 string, and numbers are in the invariant culture: a number without a fraction or an exponent that fits an int is read as an Int, any other as a Float.

JsonEncoding

Orsak.Remoting's JSON, written and parsed in plain F#, so it is the same text on .NET and Fable. Its content type, application/vnd.orsak+json, names the way Orsak.Remoting writes F# types in it, which plain application/json doesn't say.

JsonFormat

Orsak.Remoting's JSON, JsonEncoding, written the same way on .NET and Fable.

RemoteCallException

Raised when a remote call fails, for a reason that isn't the contract's: the server is unreachable, or answers with an error status, such as 401 to a caller it doesn't know. The contract's own errors are in its Result.

RemoteClient

Calls the members of remote interfaces on a server, at {baseUrl}{prefix}/{interface}/{member}, in one format, sent by one transport: what a proxy, such as one [<GenRemote>] generates, calls.

RemoteMember

A member of a remote interface, with the codecs of its arguments and result, made once: what a proxy calls.

RemoteStream

Reads a RemoteStream the same way on .NET and Fable.

RemoteStream<'T>

The items a remote member streams, as they come: an IAsyncEnumerable, so a server returns one as usual, such as an effect sequence run in its environment. Each reading is a call of its own. On Fable, which has no IAsyncEnumerable, an interface of Orsak.Remoting's own, with members of the same names.

Routes

WireFormat

A format of a self-describing encoding, such as JSON or MessagePack: the values of F# types mapped to WireValues, by WireMapping, which the encoding writes as bytes. A member's arguments are an Array.

WireMapping (Module)

Compiles WireMappings for F# types, public or not, by reflection on their types, which .NET and Fable both have for F# types: the same for every encoding, so a contract's types mean the same in each. A mapping is compiled once, for every value it converts after, and compiling it fails for a type it doesn't support, so that a client or server finds out when it starts, not on its first call.

WireMapping (Type)

Converts the values of one type to WireValues and back, compiled once for the type, by WireMapping.compile.

WireValue

A value as the self-describing formats have it, such as JSON, MessagePack and CBOR: what Orsak.Remoting turns the values of F# types into, with WireMapping, and an IWireEncoding turns into bytes.

Type something to start searching.