Skip to content

Conversation

@DerThorsten
Copy link
Member

@DerThorsten DerThorsten commented Dec 17, 2025

based on #620, but #620 was in a strange "broken" state:

@DerThorsten DerThorsten changed the title lilbuv libuv Dec 17, 2025
@DerThorsten DerThorsten changed the title libuv libuv based event loop / server Dec 17, 2025
debugger_config);
xeus::make_file_logger(xeus::xlogger::content, "xeus.log")));
// xpyt::make_python_debugger,
// debugger_config);
Copy link
Member

@JohanMabille JohanMabille Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that a leftover or does the integration of libuv break the debugger?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

atm this is just the result of merging #620 with the most recent changes / to make it build again. So I assume the debugger stuff was not yet tried

Copy link
Member

@JohanMabille JohanMabille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to be able to switch between concurrency models (i.e. uvloop vs regular multithreaded server) or is uvloop supposed to become the only concurrency model of xeus-python? I will guess the second option (otherwise we would have to provide 4 kernels and it would becoming a mess) but better to ask.

Comment on lines 106 to 123
{
py::gil_scoped_acquire acquire;

// Create a uvloop and get pointer to the loop
py::module asyncio = py::module::import("asyncio");
py::module uvloop = py::module::import("uvloop");
py::object loop = uvloop.attr("new_event_loop")();
asyncio.attr("set_event_loop")(loop);
py::object py_loop_ptr = uvloop.attr("loop").attr("libuv_get_loop_t_ptr")(loop);

void* raw_ptr = PyCapsule_GetPointer(py_loop_ptr.ptr(), nullptr);
if (!raw_ptr)
{
throw std::runtime_error("Failed to get uvloop pointer");
}

uv_loop_ptr = static_cast<uv_loop_t*>(raw_ptr);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking: This could be moved in a dedicated function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants