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:9
/// .threaded_scheduler() /// .on_thread_stop(|| { /// println!("thread stopping"); /// }) /// .build(); /// # } /// ``` #[cfg(not(loom))] pub fn on_thread_stop<F>(&mut self, f: F) -> &mut Self where F: Fn() + Send + Sync + 'static, { self....
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f4d6ed03d9a4852f5222fd191143fe34725528a6
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f4d6ed03d9a4852f5222fd191143fe34725528a6/tokio/src/runtime/builder.rs
321
380
tokio-rs/tokio:tokio/src/runtime/builder.rs:2
kind: Kind, /// Whether or not to enable the I/O driver enable_io: bool, /// Whether or not to enable the time driver enable_time: bool, /// The number of worker threads, used by Runtime. /// /// Only used when not using the current-thread executor. core_threads: Option<usize>, /...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d600ab9a8f37e9eff3fa8587069a816b65b6da0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/runtime/builder.rs
41
100
tokio-rs/tokio:tokio/src/runtime/builder.rs:3
impl Builder { /// Returns a new runtime builder initialized with default configuration /// values. /// /// Configuration methods can be chained on the return value. pub fn new() -> Builder { Builder { // No task execution by default kind: Kind::Shell, //...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d600ab9a8f37e9eff3fa8587069a816b65b6da0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/runtime/builder.rs
81
140
tokio-rs/tokio:tokio/src/runtime/builder.rs:4
/// /// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .threaded_scheduler() /// .enable_all() /// .build() /// .unwrap(); /// ``` pub fn enable_all(&mut self) -> &mut Self { #[cfg(feature = "io-driver")] self.enable_io();...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d600ab9a8f37e9eff3fa8587069a816b65b6da0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/runtime/builder.rs
121
180
tokio-rs/tokio:tokio/src/runtime/builder.rs:5
/// # Examples /// /// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .threaded_scheduler() /// .core_threads(4) /// .build() /// .unwrap(); /// ``` pub fn core_threads(&mut self, val: usize) -> &mut Self { assert_ne!(val, 0, ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d600ab9a8f37e9eff3fa8587069a816b65b6da0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/runtime/builder.rs
161
220
tokio-rs/tokio:tokio/src/runtime/builder.rs:7
F: Fn() -> String + Send + Sync + 'static, { self.thread_name = std::sync::Arc::new(f); self } /// Sets the stack size (in bytes) for worker threads. /// /// The actual stack size may be greater than this value if the platform /// specifies minimal stack size. /// /// Th...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d600ab9a8f37e9eff3fa8587069a816b65b6da0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/runtime/builder.rs
241
300
tokio-rs/tokio:tokio/src/runtime/builder.rs:8
/// /// # pub fn main() { /// let runtime = runtime::Builder::new() /// .threaded_scheduler() /// .on_thread_start(|| { /// println!("thread started"); /// }) /// .build(); /// # } /// ``` #[cfg(not(loom))] pub fn on_thread_start<F>(&mut self, f: F) ->...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d600ab9a8f37e9eff3fa8587069a816b65b6da0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/runtime/builder.rs
281
340
tokio-rs/tokio:tokio/src/runtime/builder.rs:9
F: Fn() + Send + Sync + 'static, { self.before_stop = Some(Arc::new(f)); self } /// Creates the configured `Runtime`. /// /// The returned `ThreadPool` instance is ready to spawn tasks. /// /// # Examples /// /// ``` /// use tokio::runtime::Builder; /// /...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d600ab9a8f37e9eff3fa8587069a816b65b6da0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/runtime/builder.rs
321
380
tokio-rs/tokio:tokio/src/runtime/builder.rs:10
let spawner = Spawner::Shell; let blocking_pool = blocking::create_blocking_pool(self, self.max_threads); let blocking_spawner = blocking_pool.spawner().clone(); Ok(Runtime { kind: Kind::Shell(Mutex::new(Some(Shell::new(driver)))), handle: Handle { spawn...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d600ab9a8f37e9eff3fa8587069a816b65b6da0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/runtime/builder.rs
361
420
tokio-rs/tokio:tokio/src/runtime/builder.rs:11
} } 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() /// ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d600ab9a8f37e9eff3fa8587069a816b65b6da0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/runtime/builder.rs
401
460
tokio-rs/tokio:tokio/src/runtime/builder.rs:12
self } fn build_basic_runtime(&mut self) -> io::Result<Runtime> { use crate::runtime::{BasicScheduler, Kind}; let clock = time::create_clock(); // Create I/O driver let (io_driver, io_handle) = io::create_driver(self.enable_io)?; let (drive...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d600ab9a8f37e9eff3fa8587069a816b65b6da0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/runtime/builder.rs
441
500
tokio-rs/tokio:tokio/src/runtime/builder.rs:13
impl Builder { /// Sets runtime to use a multi-threaded scheduler for executing tasks. /// /// See also [the module level documentation][1], which has a section on scheduler /// types. /// /// [1]: index.html#runtime-configurations pub fn threaded_scheduler(&mut s...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d600ab9a8f37e9eff3fa8587069a816b65b6da0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/runtime/builder.rs
481
540
tokio-rs/tokio:tokio/src/runtime/builder.rs:14
// Spawn the thread pool workers handle.enter(|| launch.launch()); Ok(Runtime { kind: Kind::ThreadPool(scheduler), handle, blocking_pool, }) } } } impl Default for Builder { fn default() -> Self { Self::new() ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d600ab9a8f37e9eff3fa8587069a816b65b6da0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/runtime/builder.rs
521
555
tokio-rs/tokio:tokio/src/runtime/builder.rs:2
kind: Kind, /// Whether or not to enable the I/O driver enable_io: bool, /// Whether or not to enable the time driver enable_time: bool, /// The number of worker threads, used by Runtime. /// /// Only used when not using the current-thread executor. core_threads: Option<usize>, /...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
4e12299826a2e3b1f40272fa6657b58ff31ef44f
github
async-runtime
https://github.com/tokio-rs/tokio/blob/4e12299826a2e3b1f40272fa6657b58ff31ef44f/tokio/src/runtime/builder.rs
41
100
tokio-rs/tokio:tokio/src/runtime/builder.rs:3
impl Builder { /// Returns a new runtime builder initialized with default configuration /// values. /// /// Configuration methods can be chained on the return value. pub fn new() -> Builder { Builder { // No task execution by default kind: Kind::Shell, //...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
4e12299826a2e3b1f40272fa6657b58ff31ef44f
github
async-runtime
https://github.com/tokio-rs/tokio/blob/4e12299826a2e3b1f40272fa6657b58ff31ef44f/tokio/src/runtime/builder.rs
81
140
tokio-rs/tokio:tokio/src/runtime/builder.rs:5
/// # Examples /// /// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .threaded_scheduler() /// .core_threads(4) /// .build() /// .unwrap(); /// ``` pub fn core_threads(&mut self, val: usize) -> &mut Self { assert_ne!(val, 0, ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
4e12299826a2e3b1f40272fa6657b58ff31ef44f
github
async-runtime
https://github.com/tokio-rs/tokio/blob/4e12299826a2e3b1f40272fa6657b58ff31ef44f/tokio/src/runtime/builder.rs
161
220
tokio-rs/tokio:tokio/src/runtime/builder.rs:7
F: Fn() -> String + Send + Sync + 'static, { self.thread_name = Arc::new(f); self } /// Sets the stack size (in bytes) for worker threads. /// /// The actual stack size may be greater than this value if the platform /// specifies minimal stack size. /// /// The default s...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
4e12299826a2e3b1f40272fa6657b58ff31ef44f
github
async-runtime
https://github.com/tokio-rs/tokio/blob/4e12299826a2e3b1f40272fa6657b58ff31ef44f/tokio/src/runtime/builder.rs
241
300
tokio-rs/tokio:tokio/src/runtime/builder.rs:8
/// /// # pub fn main() { /// let runtime = runtime::Builder::new() /// .threaded_scheduler() /// .on_thread_start(|| { /// println!("thread started"); /// }) /// .build(); /// # } /// ``` #[cfg(not(loom))] pub fn on_thread_start<F>(&mut self, f: F) ->...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
4e12299826a2e3b1f40272fa6657b58ff31ef44f
github
async-runtime
https://github.com/tokio-rs/tokio/blob/4e12299826a2e3b1f40272fa6657b58ff31ef44f/tokio/src/runtime/builder.rs
281
340
tokio-rs/tokio:tokio/src/runtime/builder.rs:9
F: Fn() + Send + Sync + 'static, { self.before_stop = Some(Arc::new(f)); self } /// Creates the configured `Runtime`. /// /// The returned `ThreadPool` instance is ready to spawn tasks. /// /// # Examples /// /// ``` /// use tokio::runtime::Builder; /// /...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
4e12299826a2e3b1f40272fa6657b58ff31ef44f
github
async-runtime
https://github.com/tokio-rs/tokio/blob/4e12299826a2e3b1f40272fa6657b58ff31ef44f/tokio/src/runtime/builder.rs
321
380
tokio-rs/tokio:tokio/src/runtime/builder.rs:10
let spawner = Spawner::Shell; let blocking_pool = blocking::create_blocking_pool(self, self.max_threads); let blocking_spawner = blocking_pool.spawner().clone(); Ok(Runtime { kind: Kind::Shell(Shell::new(driver)), handle: Handle { spawner, ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
4e12299826a2e3b1f40272fa6657b58ff31ef44f
github
async-runtime
https://github.com/tokio-rs/tokio/blob/4e12299826a2e3b1f40272fa6657b58ff31ef44f/tokio/src/runtime/builder.rs
361
420
tokio-rs/tokio:tokio/src/runtime/builder.rs:12
self } fn build_basic_runtime(&mut self) -> io::Result<Runtime> { use crate::runtime::{BasicScheduler, Kind}; let clock = time::create_clock(); // Create I/O driver let (io_driver, io_handle) = io::create_driver(self.enable_io)?; let (drive...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
4e12299826a2e3b1f40272fa6657b58ff31ef44f
github
async-runtime
https://github.com/tokio-rs/tokio/blob/4e12299826a2e3b1f40272fa6657b58ff31ef44f/tokio/src/runtime/builder.rs
441
500
tokio-rs/tokio:tokio/src/runtime/builder.rs:1
use crate::runtime::handle::Handle; use crate::runtime::shell::Shell; use crate::runtime::{blocking, io, time, Callback, Runtime, Spawner}; use std::fmt; #[cfg(not(loom))] use std::sync::Arc; /// Builds Tokio Runtime with custom configuration values. /// /// Methods can be chained in order to set the configuration va...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483/tokio/src/runtime/builder.rs
1
60
tokio-rs/tokio:tokio/src/runtime/builder.rs:2
/// The task execution model to use. kind: Kind, /// Whether or not to enable the I/O driver enable_io: bool, /// Whether or not to enable the time driver enable_time: bool, /// The number of worker threads, used by Runtime. /// /// Only used when not using the current-thread executor...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483/tokio/src/runtime/builder.rs
41
100
tokio-rs/tokio:tokio/src/runtime/builder.rs:3
/// Returns a new runtime builder initialized with default configuration /// values. /// /// Configuration methods can be chained on the return value. pub fn new() -> Builder { Builder { // No task execution by default kind: Kind::Shell, // I/O defaults to "o...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483/tokio/src/runtime/builder.rs
81
140
tokio-rs/tokio:tokio/src/runtime/builder.rs:4
/// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .threaded_scheduler() /// .enable_all() /// .build() /// .unwrap(); /// ``` pub fn enable_all(&mut self) -> &mut Self { #[cfg(feature = "io-driver")] self.enable_io(); ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483/tokio/src/runtime/builder.rs
121
180
tokio-rs/tokio:tokio/src/runtime/builder.rs:5
/// /// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .threaded_scheduler() /// .core_threads(4) /// .build() /// .unwrap(); /// ``` pub fn core_threads(&mut self, val: usize) -> &mut Self { assert_ne!(val, 0, "Core threads canno...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483/tokio/src/runtime/builder.rs
161
220
tokio-rs/tokio:tokio/src/runtime/builder.rs:7
/// 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::Builder...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483/tokio/src/runtime/builder.rs
241
300
tokio-rs/tokio:tokio/src/runtime/builder.rs:8
/// .threaded_scheduler() /// .on_thread_stop(|| { /// println!("thread stopping"); /// }) /// .build(); /// # } /// ``` #[cfg(not(loom))] pub fn on_thread_stop<F>(&mut self, f: F) -> &mut Self where F: Fn() + Send + Sync + 'static, { self....
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483/tokio/src/runtime/builder.rs
281
340
tokio-rs/tokio:tokio/src/runtime/builder.rs:9
fn build_shell_runtime(&mut self) -> io::Result<Runtime> { use crate::runtime::Kind; let clock = time::create_clock(); // Create I/O driver let (io_driver, io_handle) = io::create_driver(self.enable_io)?; let (driver, time_handle) = time::create_driver(self.enable_time, io_driv...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483/tokio/src/runtime/builder.rs
321
380
tokio-rs/tokio:tokio/src/runtime/builder.rs:10
/// /// let rt = runtime::Builder::new() /// .enable_io() /// .build() /// .unwrap(); /// ``` pub fn enable_io(&mut self) -> &mut Self { self.enable_io = true; self } } } cfg_time! { impl Builder { /// Enables t...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483/tokio/src/runtime/builder.rs
361
420
tokio-rs/tokio:tokio/src/runtime/builder.rs:11
/// The executor and all necessary drivers will all be run on the current /// thread during [`block_on`] calls. /// /// See also [the module level documentation][1], which has a section on scheduler /// types. /// /// [1]: index.html#runtime-configurations /// [`b...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483/tokio/src/runtime/builder.rs
401
460
tokio-rs/tokio:tokio/src/runtime/builder.rs:12
clock, blocking_spawner, }, blocking_pool, }) } } } cfg_rt_threaded! { impl Builder { /// Sets runtime to use a multi-threaded scheduler for executing tasks. /// /// See also [the module level documentation][1], whi...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483/tokio/src/runtime/builder.rs
441
500
tokio-rs/tokio:tokio/src/runtime/builder.rs:13
let blocking_spawner = blocking_pool.spawner().clone(); // Create the runtime handle let handle = Handle { spawner, io_handle, time_handle, clock, blocking_spawner, }; // Spawn the thread po...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f2f30d4cf6dfad9ed5b1e393b91bc2ed4e244483/tokio/src/runtime/builder.rs
481
522
tokio-rs/tokio:tokio/src/runtime/builder.rs:1
use crate::runtime::handle::Handle; use crate::runtime::shell::Shell; use crate::runtime::{blocking, io, time, Callback, Runtime, Spawner}; use std::fmt; #[cfg(not(loom))] use std::sync::Arc; /// Builds Tokio Runtime with custom configuration values. /// /// Methods can be chained in order to set the configuration va...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
1bf1928088e5cc545eee447b38da7a785099059f
github
async-runtime
https://github.com/tokio-rs/tokio/blob/1bf1928088e5cc545eee447b38da7a785099059f/tokio/src/runtime/builder.rs
1
60
tokio-rs/tokio:tokio/src/runtime/builder.rs:12
clock, blocking_spawner, }, blocking_pool, }) } } } cfg_rt_threaded! { impl Builder { /// Sets runtime to use a multi-threaded scheduler for executing tasks. /// /// See also [the module level documentation][1], whi...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
894eb8b83fa8edbee2b67e1a6a8e7a1c3d74c096
github
async-runtime
https://github.com/tokio-rs/tokio/blob/894eb8b83fa8edbee2b67e1a6a8e7a1c3d74c096/tokio/src/runtime/builder.rs
441
500
tokio-rs/tokio:tokio/src/runtime/builder.rs:13
// Create the runtime handle let handle = Handle { spawner, io_handle, time_handle, clock, blocking_spawner, }; // Spawn the thread pool workers handle.enter(|| launch.launch()); ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
894eb8b83fa8edbee2b67e1a6a8e7a1c3d74c096
github
async-runtime
https://github.com/tokio-rs/tokio/blob/894eb8b83fa8edbee2b67e1a6a8e7a1c3d74c096/tokio/src/runtime/builder.rs
481
520
tokio-rs/tokio:tokio/src/runtime/builder.rs:10
/// /// let rt = runtime::Builder::new() /// .enable_io() /// .build() /// .unwrap(); /// ``` pub fn enable_io(&mut self) -> &mut Self { self.enable_io = true; self } } } cfg_time! { impl Builder { /// Enables t...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
a78b1c65ccfb9692ca5d3ed8ddde934f40091d83
github
async-runtime
https://github.com/tokio-rs/tokio/blob/a78b1c65ccfb9692ca5d3ed8ddde934f40091d83/tokio/src/runtime/builder.rs
361
420
tokio-rs/tokio:tokio/src/runtime/builder.rs:11
/// The executor and all necessary drivers will all be run on the current /// thread during `block_on` calls. /// /// See also [the module level documentation][1], which has a section on scheduler /// types. /// /// [1]: index.html#runtime-configurations pub fn ba...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
a78b1c65ccfb9692ca5d3ed8ddde934f40091d83
github
async-runtime
https://github.com/tokio-rs/tokio/blob/a78b1c65ccfb9692ca5d3ed8ddde934f40091d83/tokio/src/runtime/builder.rs
401
460
tokio-rs/tokio:tokio/src/runtime/builder.rs:12
blocking_spawner, }, blocking_pool, }) } } } cfg_rt_threaded! { impl Builder { /// Sets runtime to use a multi-threaded scheduler for executing tasks. /// /// See also [the module level documentation][1], which has a section on schedul...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
a78b1c65ccfb9692ca5d3ed8ddde934f40091d83
github
async-runtime
https://github.com/tokio-rs/tokio/blob/a78b1c65ccfb9692ca5d3ed8ddde934f40091d83/tokio/src/runtime/builder.rs
441
500
tokio-rs/tokio:tokio/src/runtime/builder.rs:13
let handle = Handle { spawner, io_handle, time_handle, clock, blocking_spawner, }; // Spawn the thread pool workers handle.enter(|| launch.launch()); Ok(Runtime { kind: Kind:...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
a78b1c65ccfb9692ca5d3ed8ddde934f40091d83
github
async-runtime
https://github.com/tokio-rs/tokio/blob/a78b1c65ccfb9692ca5d3ed8ddde934f40091d83/tokio/src/runtime/builder.rs
481
519
tokio-rs/tokio:tokio/src/runtime/builder.rs:11
/// The executor and all necessary drivers will all be run on the current /// thread during `block_on` calls. /// /// See also [the module level documentation][1], which has a section on scheduler /// types. /// /// [1]: index.html#runtime-configurations pub fn ba...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f0d18653a6b269d88a61ab37a00abd586b2de173
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f0d18653a6b269d88a61ab37a00abd586b2de173/tokio/src/runtime/builder.rs
401
460
tokio-rs/tokio:tokio/src/runtime/builder.rs:12
blocking_spawner, }, blocking_pool, }) } } } cfg_rt_threaded! { impl Builder { /// Sets runtime to use a multi-threaded scheduler for executing tasks. /// /// See also [the module level documentation][1], which has a section on schedul...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f0d18653a6b269d88a61ab37a00abd586b2de173
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f0d18653a6b269d88a61ab37a00abd586b2de173/tokio/src/runtime/builder.rs
441
500
tokio-rs/tokio:tokio/src/runtime/builder.rs:13
let handle = Handle { spawner, io_handle, time_handle, clock, blocking_spawner, }; // Spawn the thread pool workers workers.spawn(&handle); Ok(Runtime { kind: Kind::ThreadPoo...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f0d18653a6b269d88a61ab37a00abd586b2de173
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f0d18653a6b269d88a61ab37a00abd586b2de173/tokio/src/runtime/builder.rs
481
519
tokio-rs/tokio:tokio/src/runtime/builder.rs:3
/// Returns a new runtime builder initialized with default configuration /// values. /// /// Configuration methods can be chained on the return value. pub fn new() -> Builder { Builder { // No task execution by default kind: Kind::Shell, // I/O defaults to "o...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
466dd4a851122ab2c2b11bf44148887e359fd938
github
async-runtime
https://github.com/tokio-rs/tokio/blob/466dd4a851122ab2c2b11bf44148887e359fd938/tokio/src/runtime/builder.rs
81
140
tokio-rs/tokio:tokio/src/runtime/builder.rs:4
/// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .enable_all() /// .build() /// .unwrap(); /// ``` pub fn enable_all(&mut self) -> &mut Self { #[cfg(feature = "io-driver")] self.enable_io(); #[cfg(feature = "time")] ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
466dd4a851122ab2c2b11bf44148887e359fd938
github
async-runtime
https://github.com/tokio-rs/tokio/blob/466dd4a851122ab2c2b11bf44148887e359fd938/tokio/src/runtime/builder.rs
121
180
tokio-rs/tokio:tokio/src/runtime/builder.rs:5
/// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .core_threads(4) /// .build() /// .unwrap(); /// ``` pub fn core_threads(&mut self, val: usize) -> &mut Self { assert_ne!(val, 0, "Core threads cannot be zero"); self.core_threads = S...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
466dd4a851122ab2c2b11bf44148887e359fd938
github
async-runtime
https://github.com/tokio-rs/tokio/blob/466dd4a851122ab2c2b11bf44148887e359fd938/tokio/src/runtime/builder.rs
161
220
tokio-rs/tokio:tokio/src/runtime/builder.rs:7
/// /// This is intended for bookkeeping and monitoring use cases. /// /// # Examples /// /// ``` /// # use tokio::runtime; /// /// # pub fn main() { /// let runtime = runtime::Builder::new() /// .on_thread_start(|| { /// println!("thread started"); /// })...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
466dd4a851122ab2c2b11bf44148887e359fd938
github
async-runtime
https://github.com/tokio-rs/tokio/blob/466dd4a851122ab2c2b11bf44148887e359fd938/tokio/src/runtime/builder.rs
241
300
tokio-rs/tokio:tokio/src/runtime/builder.rs:8
/// # } /// ``` #[cfg(not(loom))] pub fn on_thread_stop<F>(&mut self, f: F) -> &mut Self where F: Fn() + Send + Sync + 'static, { self.before_stop = Some(Arc::new(f)); self } /// Creates the configured `Runtime`. /// /// The returned `ThreadPool` instance is ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
466dd4a851122ab2c2b11bf44148887e359fd938
github
async-runtime
https://github.com/tokio-rs/tokio/blob/466dd4a851122ab2c2b11bf44148887e359fd938/tokio/src/runtime/builder.rs
281
340
tokio-rs/tokio:tokio/src/runtime/builder.rs:9
// Create I/O driver let (io_driver, io_handle) = io::create_driver(self.enable_io)?; let (driver, time_handle) = time::create_driver(self.enable_time, io_driver, clock.clone()); let spawner = Spawner::Shell; let blocking_pool = blocking::create_blocking_pool(self, self.max_threads); ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
466dd4a851122ab2c2b11bf44148887e359fd938
github
async-runtime
https://github.com/tokio-rs/tokio/blob/466dd4a851122ab2c2b11bf44148887e359fd938/tokio/src/runtime/builder.rs
321
380
tokio-rs/tokio:tokio/src/runtime/builder.rs:10
/// ``` pub fn enable_io(&mut self) -> &mut Self { self.enable_io = true; self } } } cfg_time! { impl Builder { /// Enables the time driver. /// /// Doing this enables using `tokio::time` on the runtime. /// /// # Examples ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
466dd4a851122ab2c2b11bf44148887e359fd938
github
async-runtime
https://github.com/tokio-rs/tokio/blob/466dd4a851122ab2c2b11bf44148887e359fd938/tokio/src/runtime/builder.rs
361
420
tokio-rs/tokio:tokio/src/runtime/builder.rs:11
} fn build_basic_runtime(&mut self) -> io::Result<Runtime> { use crate::runtime::{BasicScheduler, Kind}; let clock = time::create_clock(); // Create I/O driver let (io_driver, io_handle) = io::create_driver(self.enable_io)?; let (driver, time_handl...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
466dd4a851122ab2c2b11bf44148887e359fd938
github
async-runtime
https://github.com/tokio-rs/tokio/blob/466dd4a851122ab2c2b11bf44148887e359fd938/tokio/src/runtime/builder.rs
401
460
tokio-rs/tokio:tokio/src/runtime/builder.rs:12
/// Sets runtime to use a multi-threaded scheduler for executing tasks. pub fn threaded_scheduler(&mut self) -> &mut Self { self.kind = Kind::ThreadPool; self } fn build_threaded_runtime(&mut self) -> io::Result<Runtime> { use crate::runtime::{Kind, ThreadPoo...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
466dd4a851122ab2c2b11bf44148887e359fd938
github
async-runtime
https://github.com/tokio-rs/tokio/blob/466dd4a851122ab2c2b11bf44148887e359fd938/tokio/src/runtime/builder.rs
441
500
tokio-rs/tokio:tokio/src/runtime/builder.rs:13
}) } } } impl Default for Builder { fn default() -> Self { Self::new() } } impl fmt::Debug for Builder { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("Builder") .field("kind", &self.kind) .field("core_threads", &self.core...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
466dd4a851122ab2c2b11bf44148887e359fd938
github
async-runtime
https://github.com/tokio-rs/tokio/blob/466dd4a851122ab2c2b11bf44148887e359fd938/tokio/src/runtime/builder.rs
481
504
tokio-rs/tokio:tokio/src/runtime/builder.rs:1
use crate::runtime::handle::Handle; use crate::runtime::shell::Shell; use crate::runtime::{blocking, io, time, Callback, Runtime, Spawner}; use std::fmt; #[cfg(not(loom))] use std::sync::Arc; /// Builds Tokio Runtime with custom configuration values. /// /// Methods can be chained in order to set the configuration va...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f9ddb93604a830d106475bd4c4cae436fafcc0da
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f9ddb93604a830d106475bd4c4cae436fafcc0da/tokio/src/runtime/builder.rs
1
60
tokio-rs/tokio:tokio/src/runtime/builder.rs:2
/// The task execution model to use. kind: Kind, /// Whether or not to enable the I/O driver enable_io: bool, /// Whether or not to enable the time driver enable_time: bool, /// The number of worker threads, used by Runtime. /// /// Only used when not using the current-thread executor...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f9ddb93604a830d106475bd4c4cae436fafcc0da
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f9ddb93604a830d106475bd4c4cae436fafcc0da/tokio/src/runtime/builder.rs
41
100
tokio-rs/tokio:tokio/src/runtime/builder.rs:3
/// Returns a new runtime builder initialized with default configuration /// values. /// /// Configuration methods can be chained on the return value. pub fn new() -> Builder { Builder { // No task execution by default kind: Kind::Shell, // I/O defaults to "o...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f9ddb93604a830d106475bd4c4cae436fafcc0da
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f9ddb93604a830d106475bd4c4cae436fafcc0da/tokio/src/runtime/builder.rs
81
140
tokio-rs/tokio:tokio/src/runtime/builder.rs:4
/// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .enable_all() /// .build() /// .unwrap(); /// ``` pub fn enable_all(&mut self) -> &mut Self { #[cfg(feature = "io-driver")] self.enable_io(); #[cfg(feature = "time")] ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f9ddb93604a830d106475bd4c4cae436fafcc0da
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f9ddb93604a830d106475bd4c4cae436fafcc0da/tokio/src/runtime/builder.rs
121
180
tokio-rs/tokio:tokio/src/runtime/builder.rs:5
/// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .core_threads(4) /// .build() /// .unwrap(); /// ``` pub fn core_threads(&mut self, val: usize) -> &mut Self { assert_ne!(val, 0, "Core threads cannot be zero"); self.core_threads = v...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f9ddb93604a830d106475bd4c4cae436fafcc0da
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f9ddb93604a830d106475bd4c4cae436fafcc0da/tokio/src/runtime/builder.rs
161
220
tokio-rs/tokio:tokio/src/runtime/builder.rs:11
} fn build_basic_runtime(&mut self) -> io::Result<Runtime> { use crate::runtime::{BasicScheduler, Kind}; let clock = time::create_clock(); // Create I/O driver let (io_driver, io_handle) = io::create_driver(self.enable_io)?; let (driver, time_handl...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f9ddb93604a830d106475bd4c4cae436fafcc0da
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f9ddb93604a830d106475bd4c4cae436fafcc0da/tokio/src/runtime/builder.rs
401
460
tokio-rs/tokio:tokio/src/runtime/builder.rs:12
/// Sets runtime to use a multi-threaded scheduler for executing tasks. pub fn threaded_scheduler(&mut self) -> &mut Self { self.kind = Kind::ThreadPool; self } fn build_threaded_runtime(&mut self) -> io::Result<Runtime> { use crate::runtime::{Kind, ThreadPoo...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f9ddb93604a830d106475bd4c4cae436fafcc0da
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f9ddb93604a830d106475bd4c4cae436fafcc0da/tokio/src/runtime/builder.rs
441
500
tokio-rs/tokio:tokio/src/runtime/builder.rs:13
} } } impl Default for Builder { fn default() -> Self { Self::new() } } impl fmt::Debug for Builder { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("Builder") .field("kind", &self.kind) .field("core_threads", &self.core_threads) ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
f9ddb93604a830d106475bd4c4cae436fafcc0da
github
async-runtime
https://github.com/tokio-rs/tokio/blob/f9ddb93604a830d106475bd4c4cae436fafcc0da/tokio/src/runtime/builder.rs
481
503
tokio-rs/tokio:tokio/src/runtime/builder.rs:3
/// Returns a new runtime builder initialized with default configuration /// values. /// /// Configuration methods can be chained on the return value. pub fn new() -> Builder { Builder { // No task execution by default kind: Kind::Shell, // I/O defaults to "o...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
45da5f3510a61599c89dc458ecc859f13a81e255
github
async-runtime
https://github.com/tokio-rs/tokio/blob/45da5f3510a61599c89dc458ecc859f13a81e255/tokio/src/runtime/builder.rs
81
140
tokio-rs/tokio:tokio/src/runtime/builder.rs:4
/// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .enable_all() /// .build() /// .unwrap(); /// ``` pub fn enable_all(&mut self) -> &mut Self { #[cfg(feature = "io-driver")] self.enable_io(); #[cfg(feature = "time")] ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
45da5f3510a61599c89dc458ecc859f13a81e255
github
async-runtime
https://github.com/tokio-rs/tokio/blob/45da5f3510a61599c89dc458ecc859f13a81e255/tokio/src/runtime/builder.rs
121
180
tokio-rs/tokio:tokio/src/runtime/builder.rs:5
/// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .core_threads(4) /// .build() /// .unwrap(); /// ``` pub fn core_threads(&mut self, val: usize) -> &mut Self { assert_ne!(val, 0, "Core threads cannot be zero"); self.core_threads = v...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
45da5f3510a61599c89dc458ecc859f13a81e255
github
async-runtime
https://github.com/tokio-rs/tokio/blob/45da5f3510a61599c89dc458ecc859f13a81e255/tokio/src/runtime/builder.rs
161
220
tokio-rs/tokio:tokio/src/runtime/builder.rs:7
/// /// This is intended for bookkeeping and monitoring use cases. /// /// # Examples /// /// ``` /// # use tokio::runtime; /// /// # pub fn main() { /// let runtime = runtime::Builder::new() /// .on_thread_start(|| { /// println!("thread started"); /// })...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
45da5f3510a61599c89dc458ecc859f13a81e255
github
async-runtime
https://github.com/tokio-rs/tokio/blob/45da5f3510a61599c89dc458ecc859f13a81e255/tokio/src/runtime/builder.rs
241
300
tokio-rs/tokio:tokio/src/runtime/builder.rs:8
/// # } /// ``` #[cfg(not(loom))] pub fn on_thread_stop<F>(&mut self, f: F) -> &mut Self where F: Fn() + Send + Sync + 'static, { self.before_stop = Some(Arc::new(f)); self } /// Create the configured `Runtime`. /// /// The returned `ThreadPool` instance is r...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
45da5f3510a61599c89dc458ecc859f13a81e255
github
async-runtime
https://github.com/tokio-rs/tokio/blob/45da5f3510a61599c89dc458ecc859f13a81e255/tokio/src/runtime/builder.rs
281
340
tokio-rs/tokio:tokio/src/runtime/builder.rs:9
// Create I/O driver let (io_driver, io_handle) = io::create_driver(self.enable_io)?; let (driver, time_handle) = time::create_driver(self.enable_time, io_driver, clock.clone()); let spawner = Spawner::Shell; let blocking_pool = blocking::create_blocking_pool(self, self.max_threads); ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
45da5f3510a61599c89dc458ecc859f13a81e255
github
async-runtime
https://github.com/tokio-rs/tokio/blob/45da5f3510a61599c89dc458ecc859f13a81e255/tokio/src/runtime/builder.rs
321
380
tokio-rs/tokio:tokio/src/runtime/builder.rs:10
/// ``` pub fn enable_io(&mut self) -> &mut Self { self.enable_io = true; self } } } cfg_time! { impl Builder { /// Enable the time driver. /// /// Doing this enables using `tokio::time` on the runtime. /// /// # Examples /...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
45da5f3510a61599c89dc458ecc859f13a81e255
github
async-runtime
https://github.com/tokio-rs/tokio/blob/45da5f3510a61599c89dc458ecc859f13a81e255/tokio/src/runtime/builder.rs
361
420
tokio-rs/tokio:tokio/src/runtime/builder.rs:11
} fn build_basic_runtime(&mut self) -> io::Result<Runtime> { use crate::runtime::{BasicScheduler, Kind}; let clock = time::create_clock(); // Create I/O driver let (io_driver, io_handle) = io::create_driver(self.enable_io)?; let (driver, time_handl...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
45da5f3510a61599c89dc458ecc859f13a81e255
github
async-runtime
https://github.com/tokio-rs/tokio/blob/45da5f3510a61599c89dc458ecc859f13a81e255/tokio/src/runtime/builder.rs
401
460
tokio-rs/tokio:tokio/src/runtime/builder.rs:12
/// Use a multi-threaded scheduler for executing tasks. pub fn threaded_scheduler(&mut self) -> &mut Self { self.kind = Kind::ThreadPool; self } fn build_threaded_runtime(&mut self) -> io::Result<Runtime> { use crate::runtime::{Kind, ThreadPool}; ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
45da5f3510a61599c89dc458ecc859f13a81e255
github
async-runtime
https://github.com/tokio-rs/tokio/blob/45da5f3510a61599c89dc458ecc859f13a81e255/tokio/src/runtime/builder.rs
441
500
tokio-rs/tokio:tokio/src/runtime/builder.rs:8
/// # } /// ``` #[cfg(not(loom))] pub fn on_thread_stop<F>(&mut self, f: F) -> &mut Self where F: Fn() + Send + Sync + 'static, { self.before_stop = Some(Arc::new(f)); self } /// Create the configured `Runtime`. /// /// The returned `ThreadPool` instance is r...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
0c0f68201037af3fbaac6ca29a9806e392593d89
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0c0f68201037af3fbaac6ca29a9806e392593d89/tokio/src/runtime/builder.rs
281
340
tokio-rs/tokio:tokio/src/runtime/builder.rs:9
// Create I/O driver let (io_driver, io_handle) = io::create_driver(self.enable_io)?; let (driver, time_handle) = time::create_driver(self.enable_time, io_driver, clock.clone()); let spawner = Spawner::Shell; let blocking_pool = blocking::create_blocking_pool( self, ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
0c0f68201037af3fbaac6ca29a9806e392593d89
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0c0f68201037af3fbaac6ca29a9806e392593d89/tokio/src/runtime/builder.rs
321
380
tokio-rs/tokio:tokio/src/runtime/builder.rs:10
/// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .enable_io() /// .build() /// .unwrap(); /// ``` pub fn enable_io(&mut self) -> &mut Self { self.enable_io = true; self } } } cfg_...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
0c0f68201037af3fbaac6ca29a9806e392593d89
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0c0f68201037af3fbaac6ca29a9806e392593d89/tokio/src/runtime/builder.rs
361
420
tokio-rs/tokio:tokio/src/runtime/builder.rs:11
/// Use a simpler scheduler that runs all tasks on the current-thread. /// /// The executor and all necessary drivers will all be run on the current /// thread during `block_on` calls. pub fn basic_scheduler(&mut self) -> &mut Self { self.kind = Kind::Basic; self ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
0c0f68201037af3fbaac6ca29a9806e392593d89
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0c0f68201037af3fbaac6ca29a9806e392593d89/tokio/src/runtime/builder.rs
401
460
tokio-rs/tokio:tokio/src/runtime/builder.rs:12
}) } } } cfg_rt_threaded! { impl Builder { /// Use a multi-threaded scheduler for executing tasks. pub fn threaded_scheduler(&mut self) -> &mut Self { self.kind = Kind::ThreadPool; self } fn build_threaded_runtime(&mut self) -> io::Result<Runtime...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
0c0f68201037af3fbaac6ca29a9806e392593d89
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0c0f68201037af3fbaac6ca29a9806e392593d89/tokio/src/runtime/builder.rs
441
500
tokio-rs/tokio:tokio/src/runtime/builder.rs:13
blocking_spawner, }, blocking_pool, }) } } } impl Default for Builder { fn default() -> Self { Self::new() } } impl fmt::Debug for Builder { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("Builder") ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
0c0f68201037af3fbaac6ca29a9806e392593d89
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0c0f68201037af3fbaac6ca29a9806e392593d89/tokio/src/runtime/builder.rs
481
507
tokio-rs/tokio:tokio/src/runtime/builder.rs:4
/// ``` /// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .enable_all() /// .build() /// .unwrap(); /// ``` pub fn enable_all(&mut self) -> &mut Self { #[cfg(feature = "io-driver")] self.enable_io(); #[cfg(feature = "time")] ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
b24ad9fe861ce01add2c6533149f643e38537f59
github
async-runtime
https://github.com/tokio-rs/tokio/blob/b24ad9fe861ce01add2c6533149f643e38537f59/tokio/src/runtime/builder.rs
121
180
tokio-rs/tokio:tokio/src/runtime/builder.rs:7
/// This is intended for bookkeeping and monitoring use cases. /// /// # Examples /// /// ``` /// # use tokio::runtime; /// /// # pub fn main() { /// let runtime = runtime::Builder::new() /// .on_thread_start(|| { /// println!("thread started"); /// }) ///...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
b24ad9fe861ce01add2c6533149f643e38537f59
github
async-runtime
https://github.com/tokio-rs/tokio/blob/b24ad9fe861ce01add2c6533149f643e38537f59/tokio/src/runtime/builder.rs
241
300
tokio-rs/tokio:tokio/src/runtime/builder.rs:8
/// ``` #[cfg(not(loom))] pub fn on_thread_stop<F>(&mut self, f: F) -> &mut Self where F: Fn() + Send + Sync + 'static, { self.before_stop = Some(Arc::new(f)); self } /// Create the configured `Runtime`. /// /// The returned `ThreadPool` instance is ready to spaw...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
b24ad9fe861ce01add2c6533149f643e38537f59
github
async-runtime
https://github.com/tokio-rs/tokio/blob/b24ad9fe861ce01add2c6533149f643e38537f59/tokio/src/runtime/builder.rs
281
340
tokio-rs/tokio:tokio/src/runtime/builder.rs:9
// Create I/O driver let (io_driver, io_handle) = io::create_driver(self.enable_io)?; let (driver, time_handle) = time::create_driver(self.enable_time, io_driver, clock.clone()); let spawner = Spawner::Shell; let blocking_pool = blocking::create_blocking_pool( self, ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
b24ad9fe861ce01add2c6533149f643e38537f59
github
async-runtime
https://github.com/tokio-rs/tokio/blob/b24ad9fe861ce01add2c6533149f643e38537f59/tokio/src/runtime/builder.rs
321
380
tokio-rs/tokio:tokio/src/runtime/builder.rs:10
/// use tokio::runtime; /// /// let rt = runtime::Builder::new() /// .enable_io() /// .build() /// .unwrap(); /// ``` pub fn enable_io(&mut self) -> &mut Self { self.enable_io = true; self } } } cfg_time! { impl...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
b24ad9fe861ce01add2c6533149f643e38537f59
github
async-runtime
https://github.com/tokio-rs/tokio/blob/b24ad9fe861ce01add2c6533149f643e38537f59/tokio/src/runtime/builder.rs
361
420
tokio-rs/tokio:tokio/src/runtime/builder.rs:11
/// /// The executor and all necessary drivers will all be run on the current /// thread during `block_on` calls. pub fn basic_scheduler(&mut self) -> &mut Self { self.kind = Kind::Basic; self } fn build_basic_runtime(&mut self) -> io::Result<Runtime> { ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
b24ad9fe861ce01add2c6533149f643e38537f59
github
async-runtime
https://github.com/tokio-rs/tokio/blob/b24ad9fe861ce01add2c6533149f643e38537f59/tokio/src/runtime/builder.rs
401
460
tokio-rs/tokio:tokio/src/runtime/builder.rs:12
} } } cfg_rt_threaded! { impl Builder { /// Use a multi-threaded scheduler for executing tasks. pub fn threaded_scheduler(&mut self) -> &mut Self { self.kind = Kind::ThreadPool; self } fn build_threaded_runtime(&mut self) -> io::Result<Runtime> { ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
b24ad9fe861ce01add2c6533149f643e38537f59
github
async-runtime
https://github.com/tokio-rs/tokio/blob/b24ad9fe861ce01add2c6533149f643e38537f59/tokio/src/runtime/builder.rs
441
500
tokio-rs/tokio:tokio/src/runtime/builder.rs:13
}, blocking_pool, }) } } } impl Default for Builder { fn default() -> Self { Self::new() } } impl fmt::Debug for Builder { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("Builder") .field("kind", &self.kind)...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
b24ad9fe861ce01add2c6533149f643e38537f59
github
async-runtime
https://github.com/tokio-rs/tokio/blob/b24ad9fe861ce01add2c6533149f643e38537f59/tokio/src/runtime/builder.rs
481
506
tokio-rs/tokio:tokio/src/runtime/builder.rs:1
use crate::runtime::handle::Handle; use crate::runtime::shell::Shell; use crate::runtime::{blocking, io, time, Callback, Runtime, Spawner}; use std::fmt; #[cfg(not(loom))] use std::sync::Arc; /// Builds Tokio Runtime with custom configuration values. /// /// Methods can be chained in order to set the configuration va...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d593c5b051f07bde5117122216a356632986b6dd
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/runtime/builder.rs
1
60
tokio-rs/tokio:tokio/src/runtime/builder.rs:2
/// The task execution model to use. kind: Kind, /// Whether or not to enable the I/O driver enable_io: bool, /// Whether or not to enable the time driver enable_time: bool, /// The number of worker threads. /// /// Only used when not using the current-thread executor. num_threads...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d593c5b051f07bde5117122216a356632986b6dd
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/runtime/builder.rs
41
100
tokio-rs/tokio:tokio/src/runtime/builder.rs:3
/// Configuration methods can be chained on the return value. pub fn new() -> Builder { Builder { // No task execution by default kind: Kind::Shell, // I/O defaults to "off" enable_io: false, // Time defaults to "off" enable_time: fal...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d593c5b051f07bde5117122216a356632986b6dd
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/runtime/builder.rs
81
140
tokio-rs/tokio:tokio/src/runtime/builder.rs:4
/// .build() /// .unwrap(); /// ``` pub fn enable_all(&mut self) -> &mut Self { #[cfg(feature = "io-driver")] self.enable_io(); #[cfg(feature = "time")] self.enable_time(); self } /// Set the maximum number of worker threads for the `Runtime`'s threa...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d593c5b051f07bde5117122216a356632986b6dd
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/runtime/builder.rs
121
180
tokio-rs/tokio:tokio/src/runtime/builder.rs:7
/// # } /// ``` #[cfg(not(loom))] pub fn on_thread_stop<F>(&mut self, f: F) -> &mut Self where F: Fn() + Send + Sync + 'static, { self.before_stop = Some(Arc::new(f)); self } /// Create the configured `Runtime`. /// /// The returned `ThreadPool` instance is r...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d593c5b051f07bde5117122216a356632986b6dd
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/runtime/builder.rs
241
300
tokio-rs/tokio:tokio/src/runtime/builder.rs:8
// Create I/O driver let (io_driver, io_handle) = io::create_driver(self.enable_io)?; let (driver, time_handle) = time::create_driver(self.enable_time, io_driver, clock.clone()); let spawner = Spawner::Shell; let blocking_pool = blocking::create_blocking_pool(self, &spawner...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d593c5b051f07bde5117122216a356632986b6dd
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/runtime/builder.rs
281
340
tokio-rs/tokio:tokio/src/runtime/builder.rs:9
/// .unwrap(); /// ``` pub fn enable_io(&mut self) -> &mut Self { self.enable_io = true; self } } } cfg_time! { impl Builder { /// Enable 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
d593c5b051f07bde5117122216a356632986b6dd
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/runtime/builder.rs
321
380
tokio-rs/tokio:tokio/src/runtime/builder.rs:10
self } fn build_basic_runtime(&mut self) -> io::Result<Runtime> { use crate::runtime::{BasicScheduler, Kind}; let clock = time::create_clock(); // Create I/O driver let (io_driver, io_handle) = io::create_driver(self.enable_io)?; let (drive...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d593c5b051f07bde5117122216a356632986b6dd
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/runtime/builder.rs
361
420
tokio-rs/tokio:tokio/src/runtime/builder.rs:11
impl Builder { /// Use a multi-threaded scheduler for executing tasks. pub fn threaded_scheduler(&mut self) -> &mut Self { self.kind = Kind::ThreadPool; self } fn build_threaded_runtime(&mut self) -> io::Result<Runtime> { use crate::runtime::{Kind, Th...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d593c5b051f07bde5117122216a356632986b6dd
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/runtime/builder.rs
401
458
tokio-rs/tokio:tokio/src/runtime/builder.rs:12
impl Default for Builder { fn default() -> Self { Self::new() } } impl fmt::Debug for Builder { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("Builder") .field("kind", &self.kind) .field("num_threads", &self.num_threads) .f...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
d593c5b051f07bde5117122216a356632986b6dd
github
async-runtime
https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/runtime/builder.rs
441
458
tokio-rs/tokio:tokio/src/runtime/builder.rs:11
impl Builder { /// Use a multi-threaded scheduler for executing tasks. pub fn threaded_scheduler(&mut self) -> &mut Self { self.kind = Kind::ThreadPool; self } fn build_threaded_runtime(&mut self) -> io::Result<Runtime> { use crate::runtime::{Kind, Th...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
ec7f2ae30629e5ec164d2a65de9341cf049a2a0b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/ec7f2ae30629e5ec164d2a65de9341cf049a2a0b/tokio/src/runtime/builder.rs
401
458
tokio-rs/tokio:tokio/src/runtime/builder.rs:4
/// .build() /// .unwrap(); /// ``` pub fn enable_all(&mut self) -> &mut Self { #[cfg(feature = "io-driver")] self.enable_io(); #[cfg(feature = "time")] self.enable_time(); self } /// Set the maximum number of worker threads for the `Runtime`'s threa...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
dc356a41589a6129ec5db375e0ab9baee8612b83
github
async-runtime
https://github.com/tokio-rs/tokio/blob/dc356a41589a6129ec5db375e0ab9baee8612b83/tokio/src/runtime/builder.rs
121
180
tokio-rs/tokio:tokio/src/runtime/builder.rs:5
self.kind = Kind::Basic; self } /// Use a multi-threaded scheduler for executing tasks. #[cfg(feature = "rt-threaded")] pub fn threaded_scheduler(&mut self) -> &mut Self { self.kind = Kind::ThreadPool; self } /// Set name of threads spawned by the `Runtime`'s thread poo...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
dc356a41589a6129ec5db375e0ab9baee8612b83
github
async-runtime
https://github.com/tokio-rs/tokio/blob/dc356a41589a6129ec5db375e0ab9baee8612b83/tokio/src/runtime/builder.rs
161
220
tokio-rs/tokio:tokio/src/runtime/builder.rs:7
} /// Execute function `f` before each thread stops. /// /// This is intended for bookkeeping and monitoring use cases. /// /// # Examples /// /// ``` /// # use tokio::runtime; /// /// # pub fn main() { /// let runtime = runtime::Builder::new() /// .on_thread_stop(||...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
dc356a41589a6129ec5db375e0ab9baee8612b83
github
async-runtime
https://github.com/tokio-rs/tokio/blob/dc356a41589a6129ec5db375e0ab9baee8612b83/tokio/src/runtime/builder.rs
241
300
tokio-rs/tokio:tokio/src/runtime/builder.rs:8
/// println!("Hello from the Tokio runtime"); /// }); /// ``` pub fn build(&mut self) -> io::Result<Runtime> { match self.kind { Kind::Shell => self.build_shell_runtime(), #[cfg(feature = "rt-core")] Kind::Basic => self.build_basic_runtime(), #[cfg...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
dc356a41589a6129ec5db375e0ab9baee8612b83
github
async-runtime
https://github.com/tokio-rs/tokio/blob/dc356a41589a6129ec5db375e0ab9baee8612b83/tokio/src/runtime/builder.rs
281
340
tokio-rs/tokio:tokio/src/runtime/builder.rs:9
} cfg_io_driver! { impl Builder { /// Enable 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 = ...
rust
rust
rust-source
tokio-rs/tokio
tokio/src/runtime/builder.rs
MIT
dc356a41589a6129ec5db375e0ab9baee8612b83
github
async-runtime
https://github.com/tokio-rs/tokio/blob/dc356a41589a6129ec5db375e0ab9baee8612b83/tokio/src/runtime/builder.rs
321
380