This file contains hidden or 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 futures_io::{AsyncRead, AsyncWrite}; | |
use std::fmt; | |
use std::io; | |
use std::pin::Pin; | |
use std::task::{Context, Poll}; | |
use tokio::io::AsyncRead as TokioAsyncRead; | |
use tokio::io::AsyncWrite as TokioAsyncWrite; | |
pub trait Stream: AsyncRead + AsyncWrite + Unpin + Send + 'static {} |
This file contains hidden or 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
#!/usr/bin/env run-cargo-script | |
//! ```cargo | |
//! [package] | |
//! edition = "2018" | |
//! | |
//! [dependencies] | |
//! openssl = "*" | |
//! base64 = "*" | |
//! ``` |
This file contains hidden or 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
extern crate futures; | |
extern crate tokio; | |
use futures::*; | |
use std::sync::Arc; | |
use std::sync::Mutex; | |
use std::thread; | |
use std::time::Duration; | |
// Test stream struct. |
This file contains hidden or 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
extern crate futures; | |
extern crate tokio; | |
// instead of tokio::prelude, which also re-exports streams and futures, | |
// we use the futures crate directly to get access to futures::sync::mspc | |
use futures::*; | |
use std::thread; | |
use std::time::Duration; |
This file contains hidden or 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
// tslint:disable no-expression-statement no-let | |
/** | |
* Callbag loves TypeScript | |
* | |
* Copy-paste this into http://www.typescriptlang.org/play/index.html | |
*/ | |
enum CallbagOper { | |
Greet, |
This file contains hidden or 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
/// <reference types="mocha"/> | |
/// <reference types="node" /> | |
import xs from '../../src/index'; | |
import * as assert from 'assert'; | |
describe.only('xs.from', () => { | |
it('should have the correct order in an observable', (done: any) => { | |
const START_STATE = { | |
ver: 0, // counts up to see out of order |