Skip to content

Class Tryll::Client::ConnectedSession

ClassList > Tryll > Client > ConnectedSession

RAII pair: owns a 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
ManagedServer & GetServer () noexcept
The running ManagedServer .
const 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 ManagedServer is stopped (process termination). The declaration order of the members enforces this.

Obtain a ConnectedSession via TryllClient::RunAndConnect.

auto session = Tryll::Client::TryllClient::RunAndConnect(opts);
session.GetClient().CreateSession(Tryll::Client::TryllClient::SessionConfig{
    .engine = ::Tryll::InferenceEngine_LlamaCpp });
// …

Public Functions Documentation

function ConnectedSession [1/3]

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

function ConnectedSession [2/3]

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

function GetClient [1/2]

The connected TryllClient .

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


function GetClient [2/2]

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

function GetServer [1/2]

The running ManagedServer .

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


function GetServer [2/2]

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

function Shutdown

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

void Tryll::Client::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::Client::ConnectedSession::operator= (
    ConnectedSession &&
) noexcept

function operator=

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

function ~ConnectedSession

Tryll::Client::ConnectedSession::~ConnectedSession () 


The documentation for this class was generated from the following file C:/_tryll/_monorepo3/tryll/clients/cpp/include/tryll/TryllClient.h