A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
a11::service::ServiceOptions Struct Reference

How a service treats the connections it accepts. More...

#include <cpp/a11/service/service.h>

Public Member Functions

absl::Status Validate () const
 

Public Attributes

SessionOptions session_options
 Limits and timeouts for every session the service creates.
 
bool copy_registry_per_connection = false
 Give each connection its own copy of the registry.
 
data::ByteMap session_headers
 Headers stamped on every session the service creates.
 
absl::Duration drain_timeout = absl::Seconds(30)
 How long ~Service and Drain() wait for live sessions before abandoning them.
 
OnSessionStreamMessage on_stream_message
 Forwarded to each Session; for a service that wants raw message access.
 
OnSessionStreamDone on_stream_done
 Forwarded to each Session.
 

Detailed Description

How a service treats the connections it accepts.

Member Function Documentation

◆ Validate()

absl::Status a11::service::ServiceOptions::Validate ( ) const
Returns
OK when the options are self-consistent.

Member Data Documentation

◆ copy_registry_per_connection

bool a11::service::ServiceOptions::copy_registry_per_connection = false

Give each connection its own copy of the registry.

A service whose connections specialise their registry – registering a peer's announced tools, say – needs this, or one peer's actions become callable on another's session. Leave it false when the connection hook makes the copy itself, so there is exactly one copy and the hook owns it.

◆ drain_timeout

absl::Duration a11::service::ServiceOptions::drain_timeout = absl::Seconds(30)

How long ~Service and Drain() wait for live sessions before abandoning them.

◆ on_stream_done

OnSessionStreamDone a11::service::ServiceOptions::on_stream_done

Forwarded to each Session.

◆ on_stream_message

OnSessionStreamMessage a11::service::ServiceOptions::on_stream_message

Forwarded to each Session; for a service that wants raw message access.

◆ session_headers

data::ByteMap a11::service::ServiceOptions::session_headers

Headers stamped on every session the service creates.

◆ session_options

SessionOptions a11::service::ServiceOptions::session_options

Limits and timeouts for every session the service creates.


The documentation for this struct was generated from the following files: