mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +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
@@ -10,7 +10,7 @@ use tokio_io;
|
||||
use tokio_tls;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut runtime = Runtime::new()?;
|
||||
let runtime = Runtime::new()?;
|
||||
let addr = "www.rust-lang.org:443"
|
||||
.to_socket_addrs()?
|
||||
.next()
|
||||
|
||||
Reference in New Issue
Block a user