Closed fredrik-jansson-se closed 2 years ago
Feeling stupid, but I had missed:
unsafe {
fdb::select_api_version(fdb::FDB_API_VERSION as _);
fdb::start_network();
}
Can I suggest adding that to the documentation?
Added PR for minimal example in the docs: https://github.com/fdb-rs/fdb/pull/27
Thanks @fredrik-jansson-se for the suggestion. I've implemented a minimal example in #28 and also credited you as the co-author of the commit.
The main difference between your suggestion and the merged PR is that I've avoided using the #[tokio::main]
macro.
While there is nothing wrong in your code, when developing FoundationDB client application, its important for beginners to be aware of the presence of the network thread. FoundationDB does not have a stable client/server wire protocol like other databases do. Instead the stable API happens at the C API level.
The client thread does a lot of things for us under the hood and is an important aspect of FoundationDB. I've deliberately separated out the management of the client thread in the documentation so that by the time users gain familiarity with the rest of the API, I would have subtly nudged them into understand the importance of the client thread as well.
Thanks again for the PR.
Hey, all good, thank you!!
Hey,
first, thanks for making this available!
I'm having some issues getting started, my code looks like this:
But if I try to run it, I get this error:
Can't figure out what I'm doing wrong, so any help appreciated.
Cargo.toml
status
version