mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
runtime: create reactor per worker (#660)
This commit is contained in:
committed by
Carl Lerche
parent
886511c0a6
commit
d35d0518f5
@@ -892,4 +892,12 @@ impl WorkerId {
|
||||
pub(crate) fn new(idx: usize) -> WorkerId {
|
||||
WorkerId(idx)
|
||||
}
|
||||
|
||||
/// Returns this identifier represented as an integer.
|
||||
///
|
||||
/// Worker identifiers in a single thread pool are guaranteed to correspond to integers in the
|
||||
/// range `0..pool_size`.
|
||||
pub fn to_usize(&self) -> usize {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user