Skip to content

Instantly share code, notes, and snippets.

View ibraheemdev's full-sized avatar

Ibraheem Ahmed ibraheemdev

View GitHub Profile
struct SyncWaker {
waker: Mutex<Waker>,
state: AtomicU8,
}
const PENDING: u8 = 0;
const SIGNALED: u8 = 1;
const WAKING: u8 = 2;
impl SyncWaker {
use hyper::service::{make_service_fn, service_fn};
use hyper::{Body, Request, Response, Server};
use std::convert::Infallible;
use std::sync::Arc;
use tokio_postgres::{Client, NoTls};
#[tokio::main]
async fn main() {
let (client, connection) = tokio_postgres::connect("host=localhost user=postgres", NoTls)
.await