TscMailbox Type
Asynchronous wrapper for the serial channel. Avoids the async-api overhead of the tsc encoding.
If there is a backlog of requests after the first, then the mailbox will batch them together.
Lone callers never batch, and costs nothing extra. The synchronous api is generated to avoid unwrapping async replies in small PoCs.
The mailbox, under pressure, outperforms serial usage by a factor of 2.1-2.3 times.
Constructors
| Constructor |
Description
|
Full Usage:
TscMailbox(exePath, cwd, ?callbacks)
Parameters:
string
cwd : string
?callbacks : IDictionary<string, TsGoCallback>
Returns: TscMailbox
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.Dispose
|
Stops the agent and closes the channel, which is owned here: the channel is constructed internally and never handed out, so no caller can be holding it. Idempotent, because `use` will call this again after an explicit call. |
Full Usage:
this.Request
Parameters:
string
parameters : 'Params
Returns: Async<'Result>
Type parameters: 'Params, 'Result |
A request whose result the schema says is always present.
|
Full Usage:
this.RequestAst
Parameters:
string
parameters : 'Params
Returns: Async<SourceFile voption>
Type parameters: 'Params |
One of the four AST-returning methods. The blob is decoded here rather than handed back as bytes, matching `ProtoJson.requestAst`. The agent has already normalised the two encodings the transport uses for it, so this sees raw bytes regardless of whether the request travelled alone or in a batch.
|
Full Usage:
this.RequestNoParams
Parameters:
string
Returns: Async<'Result>
Type parameters: 'Result |
A parameterless request whose result the schema says is always present.
|
Full Usage:
this.RequestNoParamsOption
Parameters:
string
Returns: Async<'Result voption>
Type parameters: 'Result |
A parameterless request whose result the schema permits to be null.
|
Full Usage:
this.RequestOption
Parameters:
string
parameters : 'Params
Returns: Async<'Result voption>
Type parameters: 'Params, 'Result |
A request whose result the schema permits to be null.
|
Full Usage:
this.RequestUnit
Parameters:
string
parameters : 'Params
Returns: Async<unit>
Type parameters: 'Params |
A request that returns nothing. The reply is still awaited: the point of the round trip is to know the server got there, and a failure has to surface somewhere.
|
|