engine_handle.h¶
src/facade/engine_handle.h
@file engine_handle.h @brief Private definition of the entropic_engine struct.
Owners: @tvanfossen
claim
bool entropic::HandleTurnGuard::claim()
Claim the turn.
src/facade/engine_handle.h:490
Called by entropic_adapter_load, entropic_compute_perplexity, entropic_get_logprobs, entropic_run, entropic_run_as, entropic_run_batch, entropic_run_messages, entropic_run_messages_streaming, entropic_run_session, entropic_run_session_as, entropic_run_streaming, entropic_state_load
Calls try_begin_turn
Source · 6 lines
bool claim() {
if (!claimed_ && engine_ != nullptr) {
claimed_ = engine_->try_begin_turn(key_);
}
return claimed_;
}Activity · 3 steps
Requirements
claim_exclusive
bool entropic::HandleTurnGuard::claim_exclusive()
Claim the WHOLE engine: no run on any session, none may start.
src/facade/engine_handle.h:508
Source · 6 lines
bool claim_exclusive() {
if (!claimed_ && engine_ != nullptr) {
claimed_ = engine_->try_begin_turn(key_, /*exclusive=*/true);
}
return claimed_;
}Activity · 3 steps
Requirements
workspace_for
EntropicWorkspace * entropic::workspace_for(entropic_handle_t h, const std::string &key)
The workspace a session is bound to, or nullptr for the default.
src/facade/engine_handle.h:237
Source · 9 lines
inline EntropicWorkspace* workspace_for(entropic_handle_t h,
const std::string& key) {
if (h == nullptr) { return nullptr; }
std::lock_guard<std::mutex> lock(h->workspace_mutex);
auto bound = h->session_workspace.find(key);
if (bound == h->session_workspace.end()) { return nullptr; }
auto ws = h->workspaces.find(bound->second);
return ws == h->workspaces.end() ? nullptr : ws->second.get();
}Activity · 8 steps
Requirements
workspace_servers
entropic::ServerManager * entropic::workspace_servers(entropic_handle_t h, const std::string &key)
The MCP servers a session's tools must run against (gh#166).
src/facade/engine_handle.h:255
Called by SCENARIO, facade_get_tool_prompt, facade_session_root, facade_unsafe_external_tools, session_tool_names, swap_session_tool_dir, turn_outcome, wire_tool_executor
Calls workspace_for
Source · 6 lines
inline entropic::ServerManager* workspace_servers(entropic_handle_t h,
const std::string& key) {
auto* ws = workspace_for(h, key);
if (ws != nullptr && ws->servers) { return ws->servers.get(); }
return h != nullptr ? h->server_manager.get() : nullptr;
}