Skip to content

Add reqwest's blocking Client feature #58

Open
@StepanTheGreat

Description

@StepanTheGreat

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions