Skip to content

Instantly share code, notes, and snippets.

View panicbit's full-sized avatar
:shipit:
Ship it

panicbit

:shipit:
Ship it
  • Dortmund, Germany, ᐰ
View GitHub Profile
@panicbit
panicbit / keybindings.json
Last active May 10, 2019 15:00
VSCode Settings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+tab",
"command": "workbench.action.nextEditor"
},
{
"key": "ctrl+pagedown",
"command": "-workbench.action.nextEditor"
},
use std::future::Future;
use std::pin::Pin;
use std::task::{Poll, Context, Waker, RawWaker, RawWakerVTable};
use std::sync::mpsc::{sync_channel, Receiver};
use tokio::task::yield_now;
macro_rules! gen_iter {
(
@EMIT $yield_tx:ident
[]
use std::convert::Infallible;
use std::{error::Error, net::SocketAddr, time::{Instant, Duration}};
use hyper::{Body, Request, Response, Server};
use hyper::{body::Bytes, service::{make_service_fn, service_fn}};
use futures::prelude::*;
use tokio::time::delay_for;
#[tokio::main]
async fn main() {
let addr = SocketAddr::from(([0, 0, 0, 0], 7777));
fn main() {
let counter1 = Counter { name: "C1", counter: 3 };
let counter2 = Counter { name: "C2", counter: 5 };
let joined = join(counter1, counter2);
block_on(joined);
}
fn block_on(mut future: impl Future) {
loop {