Skip to content

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]

Tryll::ConnectedSession::ConnectedSession (
    ConnectedSession &&
) noexcept

function ConnectedSession [2/3]

Tryll::ConnectedSession::ConnectedSession (
    const ConnectedSession &
) = delete

function GetClient [1/2]

The connected TryllClient .

TryllClient & Tryll::ConnectedSession::GetClient () noexcept


function GetClient [2/2]

const TryllClient & Tryll::ConnectedSession::GetClient () noexcept const

function GetServer [1/2]

The running Client::ManagedServer .

Client::ManagedServer & Tryll::ConnectedSession::GetServer () noexcept


function GetServer [2/2]

const Client::ManagedServer & Tryll::ConnectedSession::GetServer () noexcept const

function Shutdown

Shut the client down, then stop the server. Idempotent.

void Tryll::ConnectedSession::Shutdown (
    std::chrono::milliseconds timeout=std::chrono::seconds{30}
) 

Parameters:

  • timeout Maximum time to wait for a graceful client shutdown.

function operator=

ConnectedSession & Tryll::ConnectedSession::operator= (
    ConnectedSession &&
) noexcept

function operator=

ConnectedSession & Tryll::ConnectedSession::operator= (
    const ConnectedSession &
) = delete

function ~ConnectedSession

Tryll::ConnectedSession::~ConnectedSession () 


The documentation for this class was generated from the following file C:/_tryll/_monorepo/server/client-cpp/include/tryll/TryllClient.h