Comments (3)
Hi,
I am running a small backend with Hyper, I was investigating this library to have an async threadpool.
I was wondering what's the difference between
bb8
andbb8-postgres
.
bb8
is the backend-agnostic parts of the library, and bb8-postgres
contains the postgres specific parts. bb8
is not usable on its own.
Also, I join the others in asking a bit more documentation and examples (tokio itself is a bit hard to grasp for newbies). The example for Postgres looks like to rely on unreleased version of the library.
Anything in particular that's confusing to you?
tokio-postgres
unfortunately has not done a real release on crates.io for almost 2 years so that part is somewhat unavoidable.
EDIT: also, do you have plans to push forward the development of the tokio-based branch of
bb8
(now that async-std is out)?
I plan to continue depending on whatever the rust-postgres
folks are depending on which I expect to remain tokio for the forseeable future.
from bb8.
Hi, thanks for the reply.
Anything in particular that's confusing to you?
Basically two things.
-
As I mentioned, not being able to build
bb8
without using a stable / released version ofbb8
itself. The examples depend on abb8
path that points to the master branch (0.3.2-pre
) which is not released.
Now, I could clone the repo, build locallybb8
, build my backend against that, but I don't feel comfortable pushing to a production environment such a hacked build workflow (or perhaps I'm missing something). I would love to be able to trybb8
with a simple$ cargo add bb8 bb8-postgres
. Should I stick to0.3.1
for the moment? A bare README file mentioning gotchas would be surely appreciated. -
The hyper example looks (to my newbie eyes) a bit barebone in that there is no decoupling of server setup and the DB pool code. In a more real-life example, I would start Hyper passing it a Service that could manage a single request or act as a router for multiple endpoints. In this scenario, would you suggest passing to
service_fn()
the whole DB pool or just a connection? Again, here's an example of what I mean.
tokio-postgres unfortunately has not done a real release on crates.io for almost 2 years so that part is somewhat unavoidable.
I see. I also see there's a 0.4.0rc in the works recently, perhaps we're not far from a new release.
In the end, for the time being, I took a slightly different approach. I'm using the sync r2d2 threadpool and passing it on to any Future that needs a DB connection: some notes about that here.
As I'm trying to figure out the whole async perf advantages scenario and whatnot, I'm not sure whether using bb8
(or any async threadpool, for the matter) would give me significant advantages. I'd need some bench or real life cases before.
from bb8.
closing because there's nothing actionable here. Will try the new release
from bb8.
Related Issues (20)
- tokio_postgres with-time-0_3 feature support is missing HOT 2
- Question about connection shutdown / clean up HOT 2
- when can we expect a new release? HOT 4
- bb8 deadlocks in rust-pool-benchmark HOT 5
- Reaper closes connections in the pool even when it violates min_idle HOT 1
- Support newer `uuid` version (1.x) HOT 3
- Question Regarding `has_broken` / bb8 usage HOT 1
- What's in bb8 0.8.0? HOT 2
- Considerable number of pedantic lints reported by clippy HOT 1
- CI keeps failing HOT 1
- Connection pool hangs if authentication fails HOT 6
- Time taken to get a connection from bb8 redis pool is very high HOT 2
- Unable to use bb8-redis pool connection to execute `query_async` commands on redis HOT 3
- Why bb8-redis can't support redis features? HOT 3
- ACL support for redis HOT 2
- Error sink not called unless debugger is attached with breakpoints HOT 2
- Reentrant deadlock HOT 5
- Reaper default frequency conflicts with other settings
- Unable to connect to secure client using bb8-redis HOT 2
- TimedOut error when has_broken = true HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bb8.