Class Tryll::ConnectedSession¶
ClassList > Tryll > ConnectedSession
RAII pair: owns a Client::ManagedServer child process and a connectedTryllClient .More...
#include <TryllClient.h>
Public Functions¶
| Type | Name |
|---|---|
| ConnectedSession (ConnectedSession &&) noexcept |
|
| ConnectedSession (const ConnectedSession &) = delete |
|
| TryllClient & | GetClient () noexcept The connected TryllClient . |
| const TryllClient & | GetClient () noexcept const |
| Client::ManagedServer & | GetServer () noexcept The running Client::ManagedServer . |
| const Client::ManagedServer & | GetServer () noexcept const |
| void | Shutdown (std::chrono::milliseconds timeout=std::chrono::seconds{30}) Shut the client down, then stop the server. Idempotent. |
| ConnectedSession & | operator= (ConnectedSession &&) noexcept |
| ConnectedSession & | operator= (const ConnectedSession &) = delete |
| ~ConnectedSession () |
Detailed Description¶
Move-only. On destruction, the TryllClient is shut down first (graceful TCP close), then the Client::ManagedServer is stopped (process termination). The declaration order of the members enforces this.
Obtain a ConnectedSession via TryllClient::RunAndConnect.
auto session = Tryll::TryllClient::RunAndConnect(opts);
session.GetClient().ConfigureSession(Tryll::Client::InferenceEngine::LlamaCpp);
// …
Public Functions Documentation¶
function ConnectedSession [1/3]¶
function ConnectedSession [2/3]¶
function GetClient [1/2]¶
The connected TryllClient .
function GetClient [2/2]¶
function GetServer [1/2]¶
The running Client::ManagedServer .
function GetServer [2/2]¶
function Shutdown¶
Shut the client down, then stop the server. Idempotent.
void Tryll::ConnectedSession::Shutdown (
std::chrono::milliseconds timeout=std::chrono::seconds{30}
)
Parameters:
timeoutMaximum time to wait for a graceful client shutdown.
function operator=¶
function operator=¶
function ~ConnectedSession¶
The documentation for this class was generated from the following file C:/_tryll/_monorepo/server/client-cpp/include/tryll/TryllClient.h