id stringlengths 22 133 | text stringlengths 40 40.2k | arch stringclasses 1
value | syntax stringclasses 1
value | kind stringclasses 4
values | repo stringclasses 27
values | path stringlengths 5 116 | license stringclasses 6
values | commit stringlengths 40 40 | source_host stringclasses 1
value | category stringclasses 16
values | source_url stringlengths 85 196 | line_start int64 1 4.28k | line_end int64 4 4.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tokio-rs/tokio:tokio/src/runtime/builder.rs:39 | /// Sets the number of buckets for the histogram tracking the
/// distribution of task poll times.
///
/// The last bucket tracks all greater values that fall out of other
/// ranges. So, configuring the histogram using a linear scale,
/// resolution of 50ms, and 10 buckets, the ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 73d733a3415af98d72c2cce40612c4e59adbd5d8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/73d733a3415af98d72c2cce40612c4e59adbd5d8/tokio/src/runtime/builder.rs | 1,521 | 1,580 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:40 | handle,
blocking_pool,
))
}
#[cfg(tokio_unstable)]
fn build_current_thread_local_runtime(&mut self) -> io::Result<LocalRuntime> {
use crate::runtime::local_runtime::LocalRuntimeScheduler;
let tid = std::thread::current().id();
let (scheduler, handle, blocking_p... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 73d733a3415af98d72c2cce40612c4e59adbd5d8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/73d733a3415af98d72c2cce40612c4e59adbd5d8/tokio/src/runtime/builder.rs | 1,561 | 1,620 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:41 | // And now put a single-threaded scheduler on top of the timer. When
// there are no futures ready to do something, it'll let the timer or
// the reactor to generate some new stimuli for the futures to continue
// in their life.
let (scheduler, handle) = CurrentThread::new(
d... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 73d733a3415af98d72c2cce40612c4e59adbd5d8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/73d733a3415af98d72c2cce40612c4e59adbd5d8/tokio/src/runtime/builder.rs | 1,601 | 1,660 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:42 | None
}
}
}
cfg_io_driver! {
impl Builder {
/// Enables the I/O driver.
///
/// Doing this enables using net, process, signal, and some I/O types on
/// the runtime.
///
/// # Examples
///
/// ```
/// use tokio::runtime;
///... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 73d733a3415af98d72c2cce40612c4e59adbd5d8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/73d733a3415af98d72c2cce40612c4e59adbd5d8/tokio/src/runtime/builder.rs | 1,641 | 1,700 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:43 | /// ```
pub fn max_io_events_per_tick(&mut self, capacity: usize) -> &mut Self {
self.nevents = capacity;
self
}
}
}
cfg_time! {
impl Builder {
/// Enables the time driver.
///
/// Doing this enables using `tokio::time` on the runtime.
///... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 73d733a3415af98d72c2cce40612c4e59adbd5d8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/73d733a3415af98d72c2cce40612c4e59adbd5d8/tokio/src/runtime/builder.rs | 1,681 | 1,740 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:44 | /// # Examples
///
/// ```
/// use tokio::runtime;
///
/// let rt = runtime::Builder::new_multi_thread()
/// .enable_io_uring()
/// .build()
/// .unwrap();
/// ```
#[cfg_attr(docsrs, doc(cfg(feature = "io-uring")))]
pub ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 73d733a3415af98d72c2cce40612c4e59adbd5d8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/73d733a3415af98d72c2cce40612c4e59adbd5d8/tokio/src/runtime/builder.rs | 1,721 | 1,780 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:45 | }
}
}
cfg_rt_multi_thread! {
impl Builder {
fn build_threaded_runtime(&mut self) -> io::Result<Runtime> {
use crate::loom::sys::num_cpus;
use crate::runtime::{Config, runtime::Scheduler};
use crate::runtime::scheduler::{self, MultiThread};
let worker_thr... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 73d733a3415af98d72c2cce40612c4e59adbd5d8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/73d733a3415af98d72c2cce40612c4e59adbd5d8/tokio/src/runtime/builder.rs | 1,761 | 1,820 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:46 | event_interval: self.event_interval,
#[cfg(tokio_unstable)]
unhandled_panic: self.unhandled_panic.clone(),
disable_lifo_slot: self.disable_lifo_slot,
seed_generator: seed_generator_1,
metrics_poll_count_histogram: self.m... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 73d733a3415af98d72c2cce40612c4e59adbd5d8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/73d733a3415af98d72c2cce40612c4e59adbd5d8/tokio/src/runtime/builder.rs | 1,801 | 1,838 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:1 | #![cfg_attr(loom, allow(unused_imports))]
use crate::runtime::handle::Handle;
use crate::runtime::{blocking, driver, Callback, HistogramBuilder, Runtime, TaskCallback};
#[cfg(tokio_unstable)]
use crate::runtime::{metrics::HistogramConfiguration, LocalOptions, LocalRuntime, TaskMeta};
use crate::util::rand::{RngSeed, R... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:2 | /// .worker_threads(4)
/// .thread_name("my-custom-name")
/// .thread_stack_size(3 * 1024 * 1024)
/// .build()
/// .unwrap();
///
/// // use runtime ...
/// }
/// # }
/// ```
pub struct Builder {
/// Runtime type
kind: Kind,
/// Whether or not to enable the I/O d... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:3 | /// To run before each worker thread stops
pub(super) before_stop: Option<Callback>,
/// To run before each worker thread is parked.
pub(super) before_park: Option<Callback>,
/// To run after each thread is unparked.
pub(super) after_unpark: Option<Callback>,
/// To run before each task is sp... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:6 | /// .unhandled_panic(UnhandledPanic::ShutdownRuntime)
/// .build()
/// .unwrap();
///
/// rt.spawn(async { panic!("boom"); });
/// rt.spawn(async {
/// // This task never completes.
/// });
///
/// rt.block_on(async {
/// ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:7 | #[cfg(loom)]
const EVENT_INTERVAL: u32 = 4;
// The number `61` is fairly arbitrary. I believe this value was copied from golang.
#[cfg(not(loom))]
const EVENT_INTERVAL: u32 = 61;
Builder::new(Kind::CurrentThread, EVENT_INTERVAL)
}
/// Returns a new builder with the mult... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:8 | max_blocking_threads: 512,
// Default thread name
thread_name: std::sync::Arc::new(|| "tokio-runtime-worker".into()),
// Do not set a stack size by default
thread_stack_size: None,
// No worker thread callbacks
after_start: None,
bef... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 281 | 340 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:9 | }
}
/// Enables both I/O and time drivers.
///
/// Doing this is a shorthand for calling `enable_io` and `enable_time`
/// individually. If additional components are added to Tokio in the future,
/// `enable_all` will include these future components.
///
/// # Examples
///
/// `... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 321 | 380 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:24 | self
}
/// Creates the configured `Runtime`.
///
/// The returned `Runtime` instance is ready to spawn tasks.
///
/// # Examples
///
/// ```
/// # #[cfg(not(target_family = "wasm"))]
/// # {
/// use tokio::runtime::Builder;
///
/// let rt = Builder::new_multi_thread... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 921 | 980 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:25 | ///
/// ```
/// use tokio::runtime::{Builder, LocalOptions};
///
/// let rt = Builder::new_current_thread()
/// .build_local(LocalOptions::default())
/// .unwrap();
///
/// rt.spawn_local(async {
/// println!("Hello from the Tokio runtime");
/// });
/// ```
#[... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 961 | 1,020 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:33 | /// # let m = rt.handle().metrics();
/// # assert_eq!(m.poll_time_histogram_num_buckets(), 10);
/// # assert_eq!(m.poll_time_histogram_bucket_range(0), us(0)..us(100));
/// # assert_eq!(m.poll_time_histogram_bucket_range(1), us(100)..us(200));
/// # }
/// ```
///
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 1,281 | 1,340 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:38 | ///
/// The last bucket tracks all greater values that fall out of other
/// ranges. So, configuring the histogram using a linear scale,
/// resolution of 50ms, and 10 buckets, the 10th bucket will track task
/// polls that take more than 450ms to complete.
///
/// **Defa... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 1,481 | 1,540 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:39 | ))
}
#[cfg(tokio_unstable)]
fn build_current_thread_local_runtime(&mut self) -> io::Result<LocalRuntime> {
use crate::runtime::local_runtime::LocalRuntimeScheduler;
let tid = std::thread::current().id();
let (scheduler, handle, blocking_pool) =
self.build_current_threa... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 1,521 | 1,580 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:40 | let (scheduler, handle) = CurrentThread::new(
driver,
driver_handle,
blocking_spawner,
seed_generator_2,
Config {
before_park: self.before_park.clone(),
after_unpark: self.after_unpark.clone(),
before_spawn: self... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 1,561 | 1,620 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:41 | cfg_io_driver! {
impl Builder {
/// Enables the I/O driver.
///
/// Doing this enables using net, process, signal, and some I/O types on
/// the runtime.
///
/// # Examples
///
/// ```
/// use tokio::runtime;
///
/// let rt = ru... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 1,601 | 1,660 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:42 | }
}
}
cfg_time! {
impl Builder {
/// Enables the time driver.
///
/// Doing this enables using `tokio::time` on the runtime.
///
/// # Examples
///
/// ```
/// # #[cfg(not(target_family = "wasm"))]
/// # {
/// use tokio::runtime;
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 1,641 | 1,700 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:43 | ///
/// let rt = runtime::Builder::new_multi_thread()
/// .enable_io_uring()
/// .build()
/// .unwrap();
/// ```
#[cfg_attr(docsrs, doc(cfg(feature = "io-uring")))]
pub fn enable_io_uring(&mut self) -> &mut Self {
// Currently, the uring fl... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 1,681 | 1,740 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:44 | cfg_rt_multi_thread! {
impl Builder {
fn build_threaded_runtime(&mut self) -> io::Result<Runtime> {
use crate::loom::sys::num_cpus;
use crate::runtime::{Config, runtime::Scheduler};
use crate::runtime::scheduler::{self, MultiThread};
let worker_threads = self... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 1,721 | 1,780 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:45 | seed_generator: seed_generator_1,
metrics_poll_count_histogram: self.metrics_poll_count_histogram_builder(),
},
);
let handle = Handle { inner: scheduler::Handle::MultiThread(handle) };
// Spawn the thread pool workers
let _enter = ha... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8ccf2fb92e7568bf16318dc8f3205cad14a9bc5d/tokio/src/runtime/builder.rs | 1,761 | 1,793 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:1 | #![cfg_attr(loom, allow(unused_imports))]
use crate::runtime::handle::Handle;
use crate::runtime::{blocking, driver, Callback, HistogramBuilder, Runtime, TaskCallback};
#[cfg(tokio_unstable)]
use crate::runtime::{metrics::HistogramConfiguration, LocalOptions, LocalRuntime, TaskMeta};
use crate::util::rand::{RngSeed, R... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:2 | /// .thread_stack_size(3 * 1024 * 1024)
/// .build()
/// .unwrap();
///
/// // use runtime ...
/// }
/// ```
pub struct Builder {
/// Runtime type
kind: Kind,
/// Whether or not to enable the I/O driver
enable_io: bool,
nevents: usize,
/// Whether or not to enable t... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:3 | /// To run before each worker thread is parked.
pub(super) before_park: Option<Callback>,
/// To run after each thread is unparked.
pub(super) after_unpark: Option<Callback>,
/// To run before each task is spawned.
pub(super) before_spawn: Option<TaskCallback>,
/// To run before each poll
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:6 | /// // This task never completes.
/// });
///
/// rt.block_on(async {
/// // Do some work
/// # loop { tokio::task::yield_now().await; }
/// })
/// # }
/// ```
///
/// [`JoinHandle`]: struct@crate::task::JoinHandle
ShutdownR... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:7 | Builder::new(Kind::CurrentThread, EVENT_INTERVAL)
}
/// Returns a new builder with the multi thread scheduler selected.
///
/// Configuration methods can be chained on the return value.
#[cfg(feature = "rt-multi-thread")]
#[cfg_attr(docsrs, doc(cfg(feature = "rt-multi-thread")))]
pub fn new... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:8 | // Do not set a stack size by default
thread_stack_size: None,
// No worker thread callbacks
after_start: None,
before_stop: None,
before_park: None,
after_unpark: None,
before_spawn: None,
after_termination: None,
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 281 | 340 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:9 | /// individually. If additional components are added to Tokio in the future,
/// `enable_all` will include these future components.
///
/// # Examples
///
/// ```
/// use tokio::runtime;
///
/// let rt = runtime::Builder::new_multi_thread()
/// .enable_all()
/// .build()
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 321 | 380 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:14 | /// # use tokio::runtime;
///
/// # pub fn main() {
/// let rt = runtime::Builder::new_multi_thread()
/// .thread_stack_size(32 * 1024)
/// .build();
/// # }
/// ```
pub fn thread_stack_size(&mut self, val: usize) -> &mut Self {
self.thread_stack_size = Some(val);
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 521 | 580 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:17 | /// if once.swap(false, Ordering::Relaxed) {
/// tokio::spawn(async move { barrier.wait().await; });
/// }
/// }
/// })
/// .build()
/// .unwrap();
///
/// runtime.block_on(async {
/// barrier.wait().await;
/// })
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 641 | 700 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:23 | self.after_termination = Some(std::sync::Arc::new(f));
self
}
/// Creates the configured `Runtime`.
///
/// The returned `Runtime` instance is ready to spawn tasks.
///
/// # Examples
///
/// ```
/// use tokio::runtime::Builder;
///
/// let rt = Builder::new_multi_t... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 881 | 940 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:24 | /// use tokio::runtime::{Builder, LocalOptions};
///
/// let rt = Builder::new_current_thread()
/// .build_local(LocalOptions::default())
/// .unwrap();
///
/// rt.spawn_local(async {
/// println!("Hello from the Tokio runtime");
/// });
/// ```
#[allow(unused_variabl... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 921 | 980 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:36 | let resolution = resolution.as_nanos() as u64;
self.metrics_poll_count_histogram.legacy_mut(|b|b.resolution = resolution);
self
}
/// Sets the number of buckets for the histogram tracking the
/// distribution of task poll times.
///
/// The last bucket t... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 1,401 | 1,460 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:37 | Ok(Runtime::from_parts(
Scheduler::CurrentThread(scheduler),
handle,
blocking_pool,
))
}
#[cfg(tokio_unstable)]
fn build_current_thread_local_runtime(&mut self) -> io::Result<LocalRuntime> {
use crate::runtime::local_runtime::LocalRuntimeScheduler;
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 1,441 | 1,500 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:38 | // And now put a single-threaded scheduler on top of the timer. When
// there are no futures ready to do something, it'll let the timer or
// the reactor to generate some new stimuli for the futures to continue
// in their life.
let (scheduler, handle) = CurrentThread::new(
d... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 1,481 | 1,540 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:39 | } else {
None
}
}
}
cfg_io_driver! {
impl Builder {
/// Enables the I/O driver.
///
/// Doing this enables using net, process, signal, and some I/O types on
/// the runtime.
///
/// # Examples
///
/// ```
/// use tokio:... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 1,521 | 1,580 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:40 | /// .unwrap();
/// ```
pub fn max_io_events_per_tick(&mut self, capacity: usize) -> &mut Self {
self.nevents = capacity;
self
}
}
}
cfg_time! {
impl Builder {
/// Enables the time driver.
///
/// Doing this enables using `tokio::time` ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 1,561 | 1,620 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:41 | /// ```
/// use tokio::runtime;
///
/// let rt = runtime::Builder::new_multi_thread()
/// .enable_io_uring()
/// .build()
/// .unwrap();
/// ```
#[cfg_attr(docsrs, doc(cfg(feature = "io-uring")))]
pub fn enable_io_uring(&mut self) -> &m... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 1,601 | 1,660 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:42 | }
cfg_rt_multi_thread! {
impl Builder {
fn build_threaded_runtime(&mut self) -> io::Result<Runtime> {
use crate::loom::sys::num_cpus;
use crate::runtime::{Config, runtime::Scheduler};
use crate::runtime::scheduler::{self, MultiThread};
let worker_threads = s... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 1,641 | 1,700 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:43 | unhandled_panic: self.unhandled_panic.clone(),
disable_lifo_slot: self.disable_lifo_slot,
seed_generator: seed_generator_1,
metrics_poll_count_histogram: self.metrics_poll_count_histogram_builder(),
},
);
let handle = H... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3b5a15dfdfc5dc789dcb80cef0986fb2fa5cac0a/tokio/src/runtime/builder.rs | 1,681 | 1,715 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:12 | /// [`fs`]: mod@crate::fs
/// [`ToSocketAddrs`]: trait@crate::net::ToSocketAddrs
/// [`Stdout`]: struct@crate::io::Stdout
/// [`Stdin`]: struct@crate::io::Stdin
/// [`Stderr`]: struct@crate::io::Stderr
/// [`worker_threads`]: Self::worker_threads
/// [`thread_keep_alive`]: Self::thread_keep_aliv... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 441 | 500 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:14 | /// # }
/// ```
pub fn thread_stack_size(&mut self, val: usize) -> &mut Self {
self.thread_stack_size = Some(val);
self
}
/// Executes function `f` after each thread is started but before it starts
/// doing work.
///
/// This is intended for bookkeeping and monitoring use c... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 521 | 580 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:17 | /// .unwrap();
///
/// runtime.block_on(async {
/// barrier.wait().await;
/// })
/// # }
/// ```
#[cfg(not(loom))]
pub fn on_thread_park<F>(&mut self, f: F) -> &mut Self
where
F: Fn() + Send + Sync + 'static,
{
self.before_park = Some(std::sync::Arc::new(f)... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 641 | 700 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:19 | /// .unwrap();
///
/// runtime.block_on(async {
/// tokio::task::spawn(std::future::ready(()));
///
/// for _ in 0..64 {
/// tokio::task::yield_now().await;
/// }
/// })
/// # }
/// ```
#[cfg(all(not(loom), tokio_unstable))]
#[cfg_attr(docsrs, doc(... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 721 | 780 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:22 | ///
/// **Note**: This is an [unstable API][unstable]. The public API of this type
/// may break in 1.x releases. See [the documentation on unstable
/// features][unstable] for details.
///
/// [unstable]: crate#unstable-features
///
/// # Examples
///
/// ```
/// # use tokio::ru... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 841 | 900 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:23 | /// The returned `Runtime` instance is ready to spawn tasks.
///
/// # Examples
///
/// ```
/// use tokio::runtime::Builder;
///
/// let rt = Builder::new_multi_thread().build().unwrap();
///
/// rt.block_on(async {
/// println!("Hello from the Tokio runtime");
/// });
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 881 | 940 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:24 | /// rt.spawn_local(async {
/// println!("Hello from the Tokio runtime");
/// });
/// ```
#[allow(unused_variables, unreachable_patterns)]
#[cfg(tokio_unstable)]
#[cfg_attr(docsrs, doc(cfg(tokio_unstable)))]
pub fn build_local(&mut self, options: LocalOptions) -> io::Result<LocalRuntime> ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 921 | 980 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:36 | /// Sets the number of buckets for the histogram tracking the
/// distribution of task poll times.
///
/// The last bucket tracks all greater values that fall out of other
/// ranges. So, configuring the histogram using a linear scale,
/// resolution of 50ms, and 10 buckets, the ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 1,401 | 1,460 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:37 | }
#[cfg(tokio_unstable)]
fn build_current_thread_local_runtime(&mut self) -> io::Result<LocalRuntime> {
use crate::runtime::local_runtime::LocalRuntimeScheduler;
let tid = std::thread::current().id();
let (scheduler, handle, blocking_pool) =
self.build_current_thread_runti... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 1,441 | 1,500 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:38 | driver,
driver_handle,
blocking_spawner,
seed_generator_2,
Config {
before_park: self.before_park.clone(),
after_unpark: self.after_unpark.clone(),
before_spawn: self.before_spawn.clone(),
#[cfg(tokio_unstabl... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 1,481 | 1,540 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:39 | cfg_io_driver! {
impl Builder {
/// Enables the I/O driver.
///
/// Doing this enables using net, process, signal, and some I/O types on
/// the runtime.
///
/// # Examples
///
/// ```
/// use tokio::runtime;
///
/// let rt = ru... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 1,521 | 1,580 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:40 | }
}
cfg_time! {
impl Builder {
/// Enables the time driver.
///
/// Doing this enables using `tokio::time` on the runtime.
///
/// # Examples
///
/// ```
/// use tokio::runtime;
///
/// let rt = runtime::Builder::new_multi_thread()
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 1,561 | 1,620 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:41 | /// .unwrap();
/// ```
#[cfg_attr(docsrs, doc(cfg(tokio_uring)))]
pub fn enable_io_uring(&mut self) -> &mut Self {
// Currently, the uring flag is equivalent to `enable_io`.
self.enable_io = true;
self
}
}
}
cfg_test_util! {
impl Builder {... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 1,601 | 1,660 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:42 | use crate::runtime::{Config, runtime::Scheduler};
use crate::runtime::scheduler::{self, MultiThread};
let worker_threads = self.worker_threads.unwrap_or_else(num_cpus);
let (driver, driver_handle) = driver::Driver::new(self.get_cfg())?;
// Create the blocking pool
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 1,641 | 1,700 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:43 | let handle = Handle { inner: scheduler::Handle::MultiThread(handle) };
// Spawn the thread pool workers
let _enter = handle.enter();
launch.launch();
Ok(Runtime::from_parts(Scheduler::MultiThread(scheduler), handle, blocking_pool))
}
}
}
impl fmt::Debug for... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 7c197c7784454b3e78aeddbad102d57f83dd98a4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7c197c7784454b3e78aeddbad102d57f83dd98a4/tokio/src/runtime/builder.rs | 1,681 | 1,709 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:36 | ///
/// The last bucket tracks all greater values that fall out of other
/// ranges. So, configuring the histogram using a linear scale,
/// resolution of 50ms, and 10 buckets, the 10th bucket will track task
/// polls that take more than 450ms to complete.
///
/// **Defa... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3e84a198e4d6283f015965cd627ee5aaff69e022 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3e84a198e4d6283f015965cd627ee5aaff69e022/tokio/src/runtime/builder.rs | 1,401 | 1,460 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:37 | #[cfg(tokio_unstable)]
fn build_current_thread_local_runtime(&mut self) -> io::Result<LocalRuntime> {
use crate::runtime::local_runtime::LocalRuntimeScheduler;
let tid = std::thread::current().id();
let (scheduler, handle, blocking_pool) =
self.build_current_thread_runtime_comp... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3e84a198e4d6283f015965cd627ee5aaff69e022 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3e84a198e4d6283f015965cd627ee5aaff69e022/tokio/src/runtime/builder.rs | 1,441 | 1,500 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:38 | blocking_spawner,
seed_generator_2,
Config {
before_park: self.before_park.clone(),
after_unpark: self.after_unpark.clone(),
before_spawn: self.before_spawn.clone(),
#[cfg(tokio_unstable)]
before_poll: self.before_po... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3e84a198e4d6283f015965cd627ee5aaff69e022 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3e84a198e4d6283f015965cd627ee5aaff69e022/tokio/src/runtime/builder.rs | 1,481 | 1,540 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:39 | /// Enables the I/O driver.
///
/// Doing this enables using net, process, signal, and some I/O types on
/// the runtime.
///
/// # Examples
///
/// ```
/// use tokio::runtime;
///
/// let rt = runtime::Builder::new_multi_thread()
/... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3e84a198e4d6283f015965cd627ee5aaff69e022 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3e84a198e4d6283f015965cd627ee5aaff69e022/tokio/src/runtime/builder.rs | 1,521 | 1,580 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:40 | cfg_time! {
impl Builder {
/// Enables the time driver.
///
/// Doing this enables using `tokio::time` on the runtime.
///
/// # Examples
///
/// ```
/// use tokio::runtime;
///
/// let rt = runtime::Builder::new_multi_thread()
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3e84a198e4d6283f015965cd627ee5aaff69e022 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3e84a198e4d6283f015965cd627ee5aaff69e022/tokio/src/runtime/builder.rs | 1,561 | 1,620 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:41 | #[cfg_attr(docsrs, doc(cfg(tokio_uring)))]
pub fn enable_io_uring(&mut self) -> &mut Self {
// Currently, the uring flag is equivalent to `enable_io`.
self.enable_io = true;
self
}
}
}
cfg_test_util! {
impl Builder {
/// Controls if the runtime's cloc... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3e84a198e4d6283f015965cd627ee5aaff69e022 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3e84a198e4d6283f015965cd627ee5aaff69e022/tokio/src/runtime/builder.rs | 1,601 | 1,660 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:42 | let worker_threads = self.worker_threads.unwrap_or_else(num_cpus);
let (driver, driver_handle) = driver::Driver::new(self.get_cfg())?;
// Create the blocking pool
let blocking_pool =
blocking::create_blocking_pool(self, self.max_blocking_threads + worker_threads);
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3e84a198e4d6283f015965cd627ee5aaff69e022 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3e84a198e4d6283f015965cd627ee5aaff69e022/tokio/src/runtime/builder.rs | 1,641 | 1,700 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:43 | // Spawn the thread pool workers
let _enter = handle.enter();
launch.launch();
Ok(Runtime::from_parts(Scheduler::MultiThread(scheduler), handle, blocking_pool))
}
}
}
impl fmt::Debug for Builder {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 3e84a198e4d6283f015965cd627ee5aaff69e022 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3e84a198e4d6283f015965cd627ee5aaff69e022/tokio/src/runtime/builder.rs | 1,681 | 1,707 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:12 | /// [`Stderr`]: struct@crate::io::Stderr
/// [`worker_threads`]: Self::worker_threads
/// [`thread_keep_alive`]: Self::thread_keep_alive
#[track_caller]
#[cfg_attr(docsrs, doc(alias = "max_threads"))]
pub fn max_blocking_threads(&mut self, val: usize) -> &mut Self {
assert!(val > 0, "Max blo... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 441 | 500 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:14 | self
}
/// Executes function `f` after each thread is started but before it starts
/// doing work.
///
/// This is intended for bookkeeping and monitoring use cases.
///
/// # Examples
///
/// ```
/// # use tokio::runtime;
/// # pub fn main() {
/// let runtime = runtime:... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 521 | 580 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:17 | /// })
/// # }
/// ```
#[cfg(not(loom))]
pub fn on_thread_park<F>(&mut self, f: F) -> &mut Self
where
F: Fn() + Send + Sync + 'static,
{
self.before_park = Some(std::sync::Arc::new(f));
self
}
/// Executes function `f` just after a thread unparks (starts executin... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 641 | 700 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:19 | ///
/// for _ in 0..64 {
/// tokio::task::yield_now().await;
/// }
/// })
/// # }
/// ```
#[cfg(all(not(loom), tokio_unstable))]
#[cfg_attr(docsrs, doc(cfg(tokio_unstable)))]
pub fn on_task_spawn<F>(&mut self, f: F) -> &mut Self
where
F: Fn(&TaskMeta<'_>) ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 721 | 780 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:20 | /// println!("task {} is about to be polled", meta.id())
/// })
/// .build()
/// .unwrap();
/// let task = rt.spawn(async {
/// yield_now().await;
/// });
/// let _ = rt.block_on(task);
///
/// # }
/// ```
#[cfg(tokio_unstable)]
#[cfg_attr(docsrs, ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 761 | 820 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:22 | ///
/// [unstable]: crate#unstable-features
///
/// # Examples
///
/// ```
/// # use tokio::runtime;
/// # pub fn main() {
/// let runtime = runtime::Builder::new_current_thread()
/// .on_task_terminate(|_| {
/// println!("killing task");
/// })
/// .b... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 841 | 900 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:23 | /// ```
/// use tokio::runtime::Builder;
///
/// let rt = Builder::new_multi_thread().build().unwrap();
///
/// rt.block_on(async {
/// println!("Hello from the Tokio runtime");
/// });
/// ```
pub fn build(&mut self) -> io::Result<Runtime> {
match &self.kind {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 881 | 940 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:24 | #[cfg_attr(docsrs, doc(cfg(tokio_unstable)))]
pub fn build_local(&mut self, options: &LocalOptions) -> io::Result<LocalRuntime> {
match &self.kind {
Kind::CurrentThread => self.build_current_thread_local_runtime(),
_ => panic!("Only current_thread is supported when building a local r... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 921 | 980 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:35 | ///
/// Note that, when using log scale, the resolution is rounded up to the
/// nearest power of 2 in nanoseconds.
///
/// **Default:** 100 microseconds.
///
/// # Examples
///
/// ```
/// use tokio::runtime;
/// use std::time::Duration;
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 1,361 | 1,420 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:36 | ///
/// # Examples
///
/// ```
/// use tokio::runtime;
///
/// # #[allow(deprecated)]
/// let rt = runtime::Builder::new_multi_thread()
/// .enable_metrics_poll_time_histogram()
/// .metrics_poll_count_histogram_buckets(15)
/// ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 1,401 | 1,460 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:37 | self.build_current_thread_runtime_components(Some(tid))?;
Ok(LocalRuntime::from_parts(
LocalRuntimeScheduler::CurrentThread(scheduler),
handle,
blocking_pool,
))
}
fn build_current_thread_runtime_components(
&mut self,
local_tid: Option<Threa... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 1,441 | 1,500 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:38 | before_poll: self.before_poll.clone(),
#[cfg(tokio_unstable)]
after_poll: self.after_poll.clone(),
after_termination: self.after_termination.clone(),
global_queue_interval: self.global_queue_interval,
event_interval: self.event_interval,
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 1,481 | 1,540 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:39 | /// ```
/// use tokio::runtime;
///
/// let rt = runtime::Builder::new_multi_thread()
/// .enable_io()
/// .build()
/// .unwrap();
/// ```
pub fn enable_io(&mut self) -> &mut Self {
self.enable_io = true;
self
}
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 1,521 | 1,580 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:40 | /// # Examples
///
/// ```
/// use tokio::runtime;
///
/// let rt = runtime::Builder::new_multi_thread()
/// .enable_time()
/// .build()
/// .unwrap();
/// ```
pub fn enable_time(&mut self) -> &mut Self {
self.enable... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 421a7b001c762a25c0b009c9ffb86f0661608f90 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/421a7b001c762a25c0b009c9ffb86f0661608f90/tokio/src/runtime/builder.rs | 1,561 | 1,620 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:22 | ///
/// [unstable]: crate#unstable-features
///
/// # Examples
///
/// ```
/// # use tokio::runtime;
/// # pub fn main() {
/// let runtime = runtime::Builder::new_current_thread()
/// .on_task_terminate(|_| {
/// println!("killing task");
/// })
/// .b... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 17d8c2b29d94550f504d8fd76d8d8aaf66095864 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/17d8c2b29d94550f504d8fd76d8d8aaf66095864/tokio/src/runtime/builder.rs | 841 | 900 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:23 | /// ```
/// use tokio::runtime::Builder;
///
/// let rt = Builder::new_multi_thread().build().unwrap();
///
/// rt.block_on(async {
/// println!("Hello from the Tokio runtime");
/// });
/// ```
pub fn build(&mut self) -> io::Result<Runtime> {
match &self.kind {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 17d8c2b29d94550f504d8fd76d8d8aaf66095864 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/17d8c2b29d94550f504d8fd76d8d8aaf66095864/tokio/src/runtime/builder.rs | 881 | 940 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:24 | #[allow(unused_variables, unreachable_patterns)]
#[cfg(tokio_unstable)]
#[cfg_attr(docsrs, doc(cfg(tokio_unstable)))]
pub fn build_local(&mut self, options: LocalOptions) -> io::Result<LocalRuntime> {
match &self.kind {
Kind::CurrentThread => self.build_current_thread_local_runtime(),
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 17d8c2b29d94550f504d8fd76d8d8aaf66095864 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/17d8c2b29d94550f504d8fd76d8d8aaf66095864/tokio/src/runtime/builder.rs | 921 | 980 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:36 | /// polls that take more than 450ms to complete.
///
/// **Default:** 10
///
/// # Examples
///
/// ```
/// use tokio::runtime;
///
/// # #[allow(deprecated)]
/// let rt = runtime::Builder::new_multi_thread()
/// .enable_metrics... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 17d8c2b29d94550f504d8fd76d8d8aaf66095864 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/17d8c2b29d94550f504d8fd76d8d8aaf66095864/tokio/src/runtime/builder.rs | 1,401 | 1,460 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:37 | let tid = std::thread::current().id();
let (scheduler, handle, blocking_pool) =
self.build_current_thread_runtime_components(Some(tid))?;
Ok(LocalRuntime::from_parts(
LocalRuntimeScheduler::CurrentThread(scheduler),
handle,
blocking_pool,
))
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 17d8c2b29d94550f504d8fd76d8d8aaf66095864 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/17d8c2b29d94550f504d8fd76d8d8aaf66095864/tokio/src/runtime/builder.rs | 1,441 | 1,500 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:38 | after_unpark: self.after_unpark.clone(),
before_spawn: self.before_spawn.clone(),
#[cfg(tokio_unstable)]
before_poll: self.before_poll.clone(),
#[cfg(tokio_unstable)]
after_poll: self.after_poll.clone(),
after_termination: s... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 17d8c2b29d94550f504d8fd76d8d8aaf66095864 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/17d8c2b29d94550f504d8fd76d8d8aaf66095864/tokio/src/runtime/builder.rs | 1,481 | 1,540 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:39 | ///
/// # Examples
///
/// ```
/// use tokio::runtime;
///
/// let rt = runtime::Builder::new_multi_thread()
/// .enable_io()
/// .build()
/// .unwrap();
/// ```
pub fn enable_io(&mut self) -> &mut Self {
sel... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 17d8c2b29d94550f504d8fd76d8d8aaf66095864 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/17d8c2b29d94550f504d8fd76d8d8aaf66095864/tokio/src/runtime/builder.rs | 1,521 | 1,580 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:40 | ///
/// Doing this enables using `tokio::time` on the runtime.
///
/// # Examples
///
/// ```
/// use tokio::runtime;
///
/// let rt = runtime::Builder::new_multi_thread()
/// .enable_time()
/// .build()
/// .unwrap();
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 17d8c2b29d94550f504d8fd76d8d8aaf66095864 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/17d8c2b29d94550f504d8fd76d8d8aaf66095864/tokio/src/runtime/builder.rs | 1,561 | 1,620 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:41 | self
}
}
}
cfg_rt_multi_thread! {
impl Builder {
fn build_threaded_runtime(&mut self) -> io::Result<Runtime> {
use crate::loom::sys::num_cpus;
use crate::runtime::{Config, runtime::Scheduler};
use crate::runtime::scheduler::{self, MultiThread};
l... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 17d8c2b29d94550f504d8fd76d8d8aaf66095864 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/17d8c2b29d94550f504d8fd76d8d8aaf66095864/tokio/src/runtime/builder.rs | 1,601 | 1,660 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:42 | global_queue_interval: self.global_queue_interval,
event_interval: self.event_interval,
#[cfg(tokio_unstable)]
unhandled_panic: self.unhandled_panic.clone(),
disable_lifo_slot: self.disable_lifo_slot,
seed_generator: see... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 17d8c2b29d94550f504d8fd76d8d8aaf66095864 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/17d8c2b29d94550f504d8fd76d8d8aaf66095864/tokio/src/runtime/builder.rs | 1,641 | 1,678 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:19 | ///
/// for _ in 0..64 {
/// tokio::task::yield_now().await;
/// }
/// })
/// # }
/// ```
#[cfg(all(not(loom), tokio_unstable))]
#[cfg_attr(docsrs, doc(cfg(tokio_unstable)))]
pub fn on_task_spawn<F>(&mut self, f: F) -> &mut Self
where
F: Fn(&TaskMeta<'_>) ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750/tokio/src/runtime/builder.rs | 721 | 780 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:20 | /// println!("task {} is about to be polled", meta.id())
/// })
/// .build()
/// .unwrap();
/// let task = rt.spawn(async {
/// yield_now().await;
/// });
/// let _ = rt.block_on(task);
///
/// # }
/// ```
#[cfg(tokio_unstable)]
pub fn on_before_ta... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750/tokio/src/runtime/builder.rs | 761 | 820 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:22 | ///
/// # Examples
///
/// ```
/// # use tokio::runtime;
/// # pub fn main() {
/// let runtime = runtime::Builder::new_current_thread()
/// .on_task_terminate(|_| {
/// println!("killing task");
/// })
/// .build()
/// .unwrap();
///
/// runtim... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750/tokio/src/runtime/builder.rs | 841 | 900 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:23 | ///
/// let rt = Builder::new_multi_thread().build().unwrap();
///
/// rt.block_on(async {
/// println!("Hello from the Tokio runtime");
/// });
/// ```
pub fn build(&mut self) -> io::Result<Runtime> {
match &self.kind {
Kind::CurrentThread => self.build_current_thre... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750/tokio/src/runtime/builder.rs | 881 | 940 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:24 | match &self.kind {
Kind::CurrentThread => self.build_current_thread_local_runtime(),
_ => panic!("Only current_thread is supported when building a local runtime"),
}
}
fn get_cfg(&self) -> driver::Cfg {
driver::Cfg {
enable_pause_time: match self.kind {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750/tokio/src/runtime/builder.rs | 921 | 980 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:31 | ///
/// let rt = runtime::Builder::new_multi_thread()
/// .enable_metrics_poll_time_histogram()
/// .build()
/// .unwrap();
/// # // Test default values here
/// # fn us(n: u64) -> std::time::Duration { std::time::Duration::from_micros(n) }
/// # let m... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750/tokio/src/runtime/builder.rs | 1,201 | 1,260 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:35 | /// nearest power of 2 in nanoseconds.
///
/// **Default:** 100 microseconds.
///
/// # Examples
///
/// ```
/// use tokio::runtime;
/// use std::time::Duration;
///
/// # #[allow(deprecated)]
/// let rt = runtime::Builder::new_mult... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750/tokio/src/runtime/builder.rs | 1,361 | 1,420 |
tokio-rs/tokio:tokio/src/runtime/builder.rs:36 | ///
/// ```
/// use tokio::runtime;
///
/// # #[allow(deprecated)]
/// let rt = runtime::Builder::new_multi_thread()
/// .enable_metrics_poll_time_histogram()
/// .metrics_poll_count_histogram_buckets(15)
/// .build()
/// .unwrap();... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/builder.rs | MIT | 1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ae9434e8e4a419ce25644e6c8d2b2e2e8c34750/tokio/src/runtime/builder.rs | 1,401 | 1,460 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.