mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 00:00:11 +02:00
Swap Handle/Pinned
* Handle -> Remote * Pinned -> Handle All APIs now take a `&Handle` by default and in general can return an immediate `io::Result` instead of an `IoFuture`. This reflects how most usage will likely be done through handles rather than remotes, and also all previous functionality can be recovered with a `oneshot` plus `Remote::spawn`. Closes #15
This commit is contained in:
+2
-4
@@ -40,8 +40,7 @@ fn connect() {
|
||||
fn accept() {
|
||||
drop(env_logger::init());
|
||||
let mut l = t!(Core::new());
|
||||
let srv = TcpListener::bind(&"127.0.0.1:0".parse().unwrap(), &l.handle());
|
||||
let srv = t!(l.run(srv));
|
||||
let srv = t!(TcpListener::bind(&t!("127.0.0.1:0".parse()), &l.handle()));
|
||||
let addr = t!(srv.local_addr());
|
||||
|
||||
let (tx, rx) = channel();
|
||||
@@ -66,8 +65,7 @@ fn accept() {
|
||||
fn accept2() {
|
||||
drop(env_logger::init());
|
||||
let mut l = t!(Core::new());
|
||||
let srv = TcpListener::bind(&"127.0.0.1:0".parse().unwrap(), &l.handle());
|
||||
let srv = t!(l.run(srv));
|
||||
let srv = t!(TcpListener::bind(&t!("127.0.0.1:0".parse()), &l.handle()));
|
||||
let addr = t!(srv.local_addr());
|
||||
|
||||
let t = thread::spawn(move || {
|
||||
|
||||
Reference in New Issue
Block a user