Skip to content
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

Add reqwest's blocking Client feature #58

Open
StepanTheGreat opened this issue Apr 10, 2024 · 0 comments
Open

Add reqwest's blocking Client feature #58

StepanTheGreat opened this issue Apr 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@StepanTheGreat
Copy link

StepanTheGreat commented Apr 10, 2024

Feature request

Is your feature request related to a problem? Please describe.

Currently Postgrest is only usable inside tokio's runtime. That's sufficient for most applications, but there are some environments that either have a different future crate, or just can't afford to use tokio (heavy binary footprint).

In my case, I'm using bevy that support only futures_lite futures. There is a way to use tokio, but it's painful and it just loses the point of using tokio in the first place (you have to manually poll it. An overkill just to use postgrest).

Describe the solution you'd like

My solution would be to create a crate feature blocking (like in reqwest), which contains the blocking module, where Postgrest uses the blocking reqwest client instead. The logic should be absolutely the same:

use postgrest::blocking::Postgrest;

let pg = Postgrest::new(url);

Describe alternatives you've considered

Currently none. Just use the postgrest syntax directly with blocking reqwest or ureq.

Additional context

The feature can also be very useful not only in game development, but for simple apps in general that can afford to block the current thread.

@StepanTheGreat StepanTheGreat added the enhancement New feature or request label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant