MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / connect_to_server_impl

Function connect_to_server_impl

crates/pyhq/src/client/server.rs:11–24  ·  view source on GitHub ↗
(
    py: Python,
    directory: Option<String>,
)

Source from the content-addressed store, hash-verified

9use crate::{ClientContextPtr, HqClientContext, borrow_mut, run_future};
10
11pub(crate) fn connect_to_server_impl(
12 py: Python,
13 directory: Option<String>,
14) -> PyResult<ClientContextPtr> {
15 let directory = directory
16 .map(|p| -> PathBuf { p.into() })
17 .unwrap_or_else(default_server_directory_path);
18
19 run_future(async move {
20 let session = get_client_session(&directory).await?;
21 let context = HqClientContext { session };
22 Py::new(py, context)
23 })
24}
25
26pub(crate) fn stop_server_impl(py: Python, ctx: ClientContextPtr) -> PyResult<()> {
27 run_future(async move {

Callers 1

connect_to_serverFunction · 0.85

Calls 3

run_futureFunction · 0.85
get_client_sessionFunction · 0.85
intoMethod · 0.80

Tested by

no test coverage detected