mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
Make threadpool::Runtime methods take &self (#1140)
The runtime is inherently multi-threaded, so it's going to have to deal with synchronization when submitting new tasks anyway. This allows a runtime to be shared by multiple threads more easily when e.g. building a blocking facade over a tokio-based API.
This commit is contained in:
committed by
Carl Lerche
parent
5c0b56278b
commit
4f6395b31c
@@ -63,7 +63,7 @@ fn fetch_google() {
|
||||
let addr = t!("google.com:443".to_socket_addrs()).next().unwrap();
|
||||
|
||||
// Create an event loop and connect a socket to our resolved address.c
|
||||
let mut l = t!(Runtime::new());
|
||||
let l = t!(Runtime::new());
|
||||
let client = TcpStream::connect(&addr);
|
||||
|
||||
// Send off the request by first negotiating an SSL handshake, then writing
|
||||
@@ -97,7 +97,7 @@ fn wrong_hostname_error() {
|
||||
|
||||
let addr = t!("google.com:443".to_socket_addrs()).next().unwrap();
|
||||
|
||||
let mut l = t!(Runtime::new());
|
||||
let l = t!(Runtime::new());
|
||||
let client = TcpStream::connect(&addr);
|
||||
let data = client.and_then(move |socket| {
|
||||
let builder = TlsConnector::builder();
|
||||
|
||||
Reference in New Issue
Block a user