libuv based event loop / server#681
Draft
DerThorsten wants to merge 34 commits intojupyter-xeus:mainfrom
Draft
Conversation
The debugger causes zmq errors somewhere
src/main.cpp
Outdated
| debugger_config); | ||
| xeus::make_file_logger(xeus::xlogger::content, "xeus.log"))); | ||
| // xpyt::make_python_debugger, | ||
| // debugger_config); |
Member
There was a problem hiding this comment.
Is that a leftover or does the integration of libuv break the debugger?
Member
Author
There was a problem hiding this comment.
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
Member
JohanMabille
left a comment
There was a problem hiding this comment.
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); | ||
| } |
Member
There was a problem hiding this comment.
Nitpicking: This could be moved in a dedicated function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
based on #620, but #620 was in a strange "broken" state:
xeus::make_xserver_uv_shell_mainbut inxeus-uvonlyxeus::make_xserver_uvexists.#include "xeus-zmq/xhook_base.hpp"is included, but this header is inxeus-uvnotxeus-zmq