This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct SyncWaker { | |
waker: Mutex<Waker>, | |
state: AtomicU8, | |
} | |
const PENDING: u8 = 0; | |
const SIGNALED: u8 = 1; | |
const WAKING: u8 = 2; | |
impl SyncWaker { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |