Capability-enforcing dispatch facade. More...
#include <session.hpp>
Public Types | |
| using | RequestHandler |
| using | ContextRequestHandler |
| using | ControllerScopeEndHandler |
| using | ClientDisconnectHandler |
Public Member Functions | |
| InspectorSession (InspectorSessionInfo info, InspectorPolicyConfig policy, RequestHandler handler, std::chrono::milliseconds lease_ttl=std::chrono::seconds(15), InspectorControllerLease::Clock clock=[] { return std::chrono::steady_clock::now();}) | |
| InspectorSession (InspectorSessionInfo info, InspectorPolicyConfig policy, ContextRequestHandler handler, std::chrono::milliseconds lease_ttl=std::chrono::seconds(15), InspectorControllerLease::Clock clock=[] { return std::chrono::steady_clock::now();}) | |
| ~InspectorSession () | |
| InspectorMessage | handle (std::string_view client_id, const InspectorMessage &request) |
| void | set_main_thread_rpc (std::shared_ptr< InspectorMainThreadRpc > rpc) |
| Install the generation-scoped main-thread handoff used for domain requests. | |
| void | set_concurrent_request_handler (std::string method, ContextRequestHandler handler) |
| Route one exact authorized method through a handler that is safe to run concurrently on its transport thread. | |
| void | set_controller_scope_end_handler (ControllerScopeEndHandler handler) |
| Install the host cleanup hook for controller-scoped test input. | |
| void | set_client_disconnect_handler (ClientDisconnectHandler handler) |
| Install generation-scoped cleanup for per-client domain state. | |
| void | set_audit_log (std::shared_ptr< InspectorAuditLog > audit_log) |
| void | disconnect (std::string_view client_id) |
| void | close_dispatch_admission () |
| Refuse new work without waiting for already-admitted concurrent work. | |
| void | after_concurrent_dispatches (std::function< void()> completion) |
| Run completion after every already-admitted concurrent dispatch has returned. | |
| void | suspend_dispatches () |
| Cancel queued domain handlers and reject new ones during server teardown. | |
| void | resume_dispatches () |
| Reopen domain-handler admission for a new authenticated server generation. | |
| bool | dispatches_accepting () const |
| Snapshot whether new domain dispatches are currently admitted. | |
| const InspectorSessionInfo & | info () const |
| const InspectorAccessPolicy & | policy () const |
Capability-enforcing dispatch facade.
Transport supplies an authenticated per-connection client identity; the session owns policy and the controller lease, then serializes authorized domain requests before delegating to the attached handler. Session control remains available while a handler runs.
| pulp::inspect::InspectorSession::InspectorSession | ( | InspectorSessionInfo | info, |
| InspectorPolicyConfig | policy, | ||
| RequestHandler | handler, | ||
| std::chrono::milliseconds | lease_ttl = std::chrono::seconds(15), | ||
| InspectorControllerLease::Clock | clock = [] { return std::chrono::steady_clock::now();} ) |
| pulp::inspect::InspectorSession::InspectorSession | ( | InspectorSessionInfo | info, |
| InspectorPolicyConfig | policy, | ||
| ContextRequestHandler | handler, | ||
| std::chrono::milliseconds | lease_ttl = std::chrono::seconds(15), | ||
| InspectorControllerLease::Clock | clock = [] { return std::chrono::steady_clock::now();} ) |
| pulp::inspect::InspectorSession::~InspectorSession | ( | ) |
| void pulp::inspect::InspectorSession::after_concurrent_dispatches | ( | std::function< void()> | completion | ) |
Run completion after every already-admitted concurrent dispatch has returned.
Teardown uses this to break main-thread RPC wait cycles.
| void pulp::inspect::InspectorSession::close_dispatch_admission | ( | ) |
Refuse new work without waiting for already-admitted concurrent work.
Reentrant teardown uses this before deferring the actual drain.
| void pulp::inspect::InspectorSession::disconnect | ( | std::string_view | client_id | ) |
| bool pulp::inspect::InspectorSession::dispatches_accepting | ( | ) | const |
Snapshot whether new domain dispatches are currently admitted.
| InspectorMessage pulp::inspect::InspectorSession::handle | ( | std::string_view | client_id, |
| const InspectorMessage & | request ) |
|
inline |
|
inline |
| void pulp::inspect::InspectorSession::resume_dispatches | ( | ) |
Reopen domain-handler admission for a new authenticated server generation.
| void pulp::inspect::InspectorSession::set_audit_log | ( | std::shared_ptr< InspectorAuditLog > | audit_log | ) |
| void pulp::inspect::InspectorSession::set_client_disconnect_handler | ( | ClientDisconnectHandler | handler | ) |
Install generation-scoped cleanup for per-client domain state.
The callback runs outside session locks and may be called from a transport callback thread; it must hand off to its owner when necessary.
| void pulp::inspect::InspectorSession::set_concurrent_request_handler | ( | std::string | method, |
| ContextRequestHandler | handler ) |
Route one exact authorized method through a handler that is safe to run concurrently on its transport thread.
This is reserved for operations, such as interruption, that must reach work currently occupying the serialized main-thread lane. Passing an empty handler removes the route.
| void pulp::inspect::InspectorSession::set_controller_scope_end_handler | ( | ControllerScopeEndHandler | handler | ) |
Install the host cleanup hook for controller-scoped test input.
The callback runs outside session locks and must transfer work to the host's owning thread when the caller is not already on it.
| void pulp::inspect::InspectorSession::set_main_thread_rpc | ( | std::shared_ptr< InspectorMainThreadRpc > | rpc | ) |
Install the generation-scoped main-thread handoff used for domain requests.
Session control methods remain synchronous on their caller.
| void pulp::inspect::InspectorSession::suspend_dispatches | ( | ) |
Cancel queued domain handlers and reject new ones during server teardown.
The handler already executing on the dispatch owner may finish.