-
Notifications
You must be signed in to change notification settings - Fork 262
feat(cpp): Create initial client #2661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
An integration test from connectors is failing, which is unrelated to the changes I made. |
|
@slbotbm couple of questions from my side:
I didn't review the code yet, I just skimmed thru it. |
|
Thanks for your questions.
On a side note, the connectors' quickwit integration tests are failing. |
|
Tests should now pass, i merged #2667 and rebased your PR. Regarding 3: event loop - the current design calls I'm fine with either, just keep in mind that at some point in future we want to add proper sans-io based Rust SDK. |
|
Just to add, python sdk uses pyo3 async runtimes, where we convert from Rust futures to python coroutines: #[gen_stub(override_return_type(type_repr="collections.abc.Awaitable[None]", imports=("collections.abc")))]
fn ping<'a>(&self, py: Python<'a>) -> PyResult<Bound<'a, PyAny>> {
let inner = self.inner.clone();
future_into_py(py, async move {
inner
.ping()
.await
.map_err(|e| PyErr::new::<pyo3::exceptions::PyRuntimeError, _>(format!("{e:?}")))
})
}EDIT: if you require C++20 you can use https://github.com/pcwalton/cxx-async so you'll be able to call EDIT 2: also check https://cxx.rs/async.html EDIT 3: also check https://github.com/mozilla/uniffi-rs + https://github.com/NordSecurity/uniffi-bindgen-cpp |
|
Thank you for the explanation. The part about the event loop was something I had wanted to explain in the design, so please allo me time until Friday-Saturday to create the discussion. |
|
@slbotbm no problem, take your time. it's not easy topic :) |
Which issue does this PR close?
Closes #2100
Rationale
This PR implements a blocking c++ client using CXX.
I'll open a discussion on the design by the weekend.The discussion can be seen at #2691 . Tests/CI scripts haven't been added yet. After the design is finalized, I'll add them.What changed?
Deletes the old incomplete client. Adds a client that uses cxx to generate rust -> cpp bindings.
examples/example.cpphas been temporarily included to show how the public API would look like. instructions on running it are included inREADME.md.Local Execution
AI Usage