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/current_thread/builder.rs:1 | use crate::runtime::current_thread::Runtime;
use crate::timer::clock::Clock;
use crate::timer::timer::Timer;
use tokio_executor::current_thread::CurrentThread;
use tokio_net::driver::Reactor;
use std::io;
/// Builds a Single-threaded runtime with custom configuration values.
///
/// Methods can be chained in order t... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | b8cee1a60ad99ef28ec494ae4230e2ef4399fcf9 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b8cee1a60ad99ef28ec494ae4230e2ef4399fcf9/tokio/src/runtime/current_thread/builder.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:1 | use crate::runtime::current_thread::Runtime;
use tokio_executor::current_thread::CurrentThread;
use tokio_net::driver::Reactor;
use tokio_timer::clock::Clock;
use tokio_timer::timer::Timer;
use std::io;
/// Builds a Single-threaded runtime with custom configuration values.
///
/// Methods can be chained in order to ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | f1f61a3b15d17767b12bfd8c0c5712db1b089b0b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/f1f61a3b15d17767b12bfd8c0c5712db1b089b0b/tokio/src/runtime/current_thread/builder.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:2 | clock: Clock,
}
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 {
clock: Clock::new(),
}
}
/// Set the `Clock`... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | f1f61a3b15d17767b12bfd8c0c5712db1b089b0b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/f1f61a3b15d17767b12bfd8c0c5712db1b089b0b/tokio/src/runtime/current_thread/builder.rs | 41 | 92 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:1 | use crate::runtime::current_thread::Runtime;
use tokio_executor::current_thread::CurrentThread;
use tokio_net::Reactor;
use tokio_timer::clock::Clock;
use tokio_timer::timer::Timer;
use std::io;
/// Builds a Single-threaded runtime with custom configuration values.
///
/// Methods can be chained in order to set the ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | 8538c25170240fa46313ffe9d4a9a2f9ba2536e5 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8538c25170240fa46313ffe9d4a9a2f9ba2536e5/tokio/src/runtime/current_thread/builder.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:1 | use crate::runtime::current_thread::Runtime;
use tokio_executor::current_thread::CurrentThread;
use tokio_reactor::Reactor;
use tokio_timer::clock::Clock;
use tokio_timer::timer::Timer;
use std::io;
/// Builds a Single-threaded runtime with custom configuration values.
///
/// Methods can be chained in order to set ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | 9de7083be89bde2e26ee5bc4f3333f5c8d13762d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9de7083be89bde2e26ee5bc4f3333f5c8d13762d/tokio/src/runtime/current_thread/builder.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:1 | use crate::runtime::current_thread::Runtime;
use tokio_current_thread::CurrentThread;
use tokio_reactor::Reactor;
use tokio_timer::clock::Clock;
use tokio_timer::timer::Timer;
use std::io;
/// Builds a Single-threaded runtime with custom configuration values.
///
/// Methods can be chained in order to set the configur... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | 47e2ff48d9f1daac7dba9f136b24eed64c87cf40 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/47e2ff48d9f1daac7dba9f136b24eed64c87cf40/tokio/src/runtime/current_thread/builder.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:2 | 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 {
clock: Clock::new(),
}
}
/// Set the `Clock` instance that wi... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | 47e2ff48d9f1daac7dba9f136b24eed64c87cf40 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/47e2ff48d9f1daac7dba9f136b24eed64c87cf40/tokio/src/runtime/current_thread/builder.rs | 41 | 90 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:3 | Ok(runtime)
}
}
impl Default for Builder {
fn default() -> Self {
Self::new()
}
} | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | 47e2ff48d9f1daac7dba9f136b24eed64c87cf40 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/47e2ff48d9f1daac7dba9f136b24eed64c87cf40/tokio/src/runtime/current_thread/builder.rs | 81 | 90 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:1 | use crate::runtime::current_thread::Runtime;
use tokio_current_thread::CurrentThread;
use tokio_reactor::Reactor;
use tokio_timer::clock::Clock;
use tokio_timer::timer::Timer;
use std::io;
/// Builds a Single-threaded runtime with custom configuration values.
///
/// Methods can be chained in order to set the configur... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | fe021e6c008a886c1c6ad97c9f5f0c667fad34c6 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/fe021e6c008a886c1c6ad97c9f5f0c667fad34c6/tokio/src/runtime/current_thread/builder.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:2 | 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 {
clock: Clock::new(),
}
}
/// Set the `Clock` instance that wi... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | 70eca184f0f52dd2d634b750bba698da9418ee5f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/70eca184f0f52dd2d634b750bba698da9418ee5f/tokio/src/runtime/current_thread/builder.rs | 41 | 84 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:1 | use crate::runtime::current_thread::Runtime;
use tokio_current_thread::CurrentThread;
use tokio_reactor::Reactor;
//use tokio_timer::clock::Clock;
//use tokio_timer::timer::Timer;
use std::io;
/// Builds a Single-threaded runtime with custom configuration values.
///
/// Methods can be chained in order to set the conf... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | 29e417c257c62ae95cfa73f6b56825b3f833dde8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/29e417c257c62ae95cfa73f6b56825b3f833dde8/tokio/src/runtime/current_thread/builder.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:2 | 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 {
//clock: Clock::new(),
}
}
/*
/// Set the `Clock` instanc... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | 29e417c257c62ae95cfa73f6b56825b3f833dde8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/29e417c257c62ae95cfa73f6b56825b3f833dde8/tokio/src/runtime/current_thread/builder.rs | 41 | 86 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:1 | use crate::runtime::current_thread::Runtime;
use tokio_current_thread::CurrentThread;
use tokio_reactor::Reactor;
//use tokio_timer::clock::Clock;
//use tokio_timer::timer::Timer;
use std::io;
/// Builds a Single-threaded runtime with custom configuration values.
///
/// Methods can be chained in order to set the conf... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | 06c473e62842d257ed275497ce906710ea3f8e19 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/06c473e62842d257ed275497ce906710ea3f8e19/tokio/src/runtime/current_thread/builder.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:2 | 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 {
//clock: Clock::new(),
}
}
/*
/// Set the `Clock` instanc... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | 06c473e62842d257ed275497ce906710ea3f8e19 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/06c473e62842d257ed275497ce906710ea3f8e19/tokio/src/runtime/current_thread/builder.rs | 41 | 85 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:1 | use crate::executor::current_thread::CurrentThread;
use crate::runtime::current_thread::Runtime;
use tokio_reactor::Reactor;
use tokio_timer::clock::Clock;
use tokio_timer::timer::Timer;
use std::io;
/// Builds a Single-threaded runtime with custom configuration values.
///
/// Methods can be chained in order to set t... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/current_thread/builder.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/builder.rs:2 | 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 {
clock: Clock::new(),
}
}
/// Set the `Clock` instance that wi... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/builder.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/current_thread/builder.rs | 41 | 83 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:1 | use crate::runtime::park::{Park, Unpark};
use crate::task::{self, JoinHandle, Schedule, Task};
use std::cell::UnsafeCell;
use std::collections::VecDeque;
use std::fmt;
use std::future::Future;
use std::mem::ManuallyDrop;
use std::sync::{Arc, Mutex};
use std::task::{RawWaker, RawWakerVTable, Waker};
use std::time::Dura... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 27e5b41067d01c0c9fac230c5addb58034201a63 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/27e5b41067d01c0c9fac230c5addb58034201a63/tokio/src/runtime/current_thread/mod.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:2 | ///
/// Tasks notified from the current thread are pushed into this queue.
///
/// # Safety
///
/// References should not be handed out. Only call `push` / `pop` functions.
/// Only call from the owning thread.
local_queue: UnsafeCell<VecDeque<Task<Scheduler>>>,
/// Remote run queue.
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 27e5b41067d01c0c9fac230c5addb58034201a63 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/27e5b41067d01c0c9fac230c5addb58034201a63/tokio/src/runtime/current_thread/mod.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:3 | open: bool,
}
/// Max number of tasks to poll per tick.
const MAX_TASKS_PER_TICK: usize = 61;
/// How often to check the remote queue first
const CHECK_REMOTE_INTERVAL: u8 = 13;
impl<P> CurrentThread<P>
where
P: Park,
{
pub(crate) fn new(park: P) -> CurrentThread<P> {
let unpark = park.unpark();
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 27e5b41067d01c0c9fac230c5addb58034201a63 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/27e5b41067d01c0c9fac230c5addb58034201a63/tokio/src/runtime/current_thread/mod.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:4 | F: Future + Send + 'static,
F::Output: Send + 'static,
{
let (task, handle) = task::joinable(future);
self.scheduler.schedule(task);
handle
}
pub(crate) fn block_on<F>(&mut self, mut future: F) -> F::Output
where
F: Future,
{
use crate::runtime;
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 27e5b41067d01c0c9fac230c5addb58034201a63 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/27e5b41067d01c0c9fac230c5addb58034201a63/tokio/src/runtime/current_thread/mod.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:5 | scheduler.tick(local);
// Maintenance work
scheduler.drain_pending_drop();
}
})
}
}
impl Spawner {
/// Spawn a future onto the thread pool
pub(crate) fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
where
F: Future + Send + 'static,
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 27e5b41067d01c0c9fac230c5addb58034201a63 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/27e5b41067d01c0c9fac230c5addb58034201a63/tokio/src/runtime/current_thread/mod.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:6 | if let Some(task) = task.run(&mut || Some(self.into())) {
unsafe {
self.schedule_local(task);
}
}
}
local
.park
.park_timeout(Duration::from_millis(0))
.ok()
.expect("failed to park");
}
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 27e5b41067d01c0c9fac230c5addb58034201a63 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/27e5b41067d01c0c9fac230c5addb58034201a63/tokio/src/runtime/current_thread/mod.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:7 | if 0 == tick % CHECK_REMOTE_INTERVAL {
self.next_remote_task().or_else(|| self.next_local_task())
} else {
self.next_local_task().or_else(|| self.next_remote_task())
}
}
fn next_local_task(&self) -> Option<Task<Self>> {
unsafe { (*self.local_queue.get()).pop_fron... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 27e5b41067d01c0c9fac230c5addb58034201a63 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/27e5b41067d01c0c9fac230c5addb58034201a63/tokio/src/runtime/current_thread/mod.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:8 | if lock.open {
lock.queue.push_back(task);
} else {
task.shutdown();
}
// while locked, call unpark
self.unpark.unpark();
drop(lock);
}
}
}
impl<P> Drop for CurrentThread<P>
where
P: Park,
{
fn drop(&mut s... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 27e5b41067d01c0c9fac230c5addb58034201a63 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/27e5b41067d01c0c9fac230c5addb58034201a63/tokio/src/runtime/current_thread/mod.rs | 281 | 340 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:9 | self.scheduler.drain_pending_drop();
// Wait until all tasks have been released.
while unsafe { !(*self.scheduler.owned_tasks.get()).is_empty() } {
self.local.park.park().ok().expect("park failed");
self.scheduler.drain_pending_drop();
}
}
}
impl fmt::Debug for Sche... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 27e5b41067d01c0c9fac230c5addb58034201a63 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/27e5b41067d01c0c9fac230c5addb58034201a63/tokio/src/runtime/current_thread/mod.rs | 321 | 365 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:1 | use crate::runtime::park::{Park, Unpark};
use crate::runtime::task::{self, JoinHandle, Schedule, Task};
use std::cell::UnsafeCell;
use std::collections::VecDeque;
use std::fmt;
use std::future::Future;
use std::mem::ManuallyDrop;
use std::sync::{Arc, Mutex};
use std::task::{RawWaker, RawWakerVTable, Waker};
use std::t... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 1a7f6fb201c04e8bb02c6e59ddaabadceb8413c2 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1a7f6fb201c04e8bb02c6e59ddaabadceb8413c2/tokio/src/runtime/current_thread/mod.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:4 | F: Future + Send + 'static,
F::Output: Send + 'static,
{
let (task, handle) = task::joinable(future);
self.scheduler.schedule(task);
handle
}
pub(crate) fn block_on<F>(&mut self, mut future: F) -> F::Output
where
F: Future,
{
use crate::runtime;
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 0da23aad772afb22db8edf73ac0f034c5ada3bde | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0da23aad772afb22db8edf73ac0f034c5ada3bde/tokio/src/runtime/current_thread/mod.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:5 | }
scheduler.tick(local);
// Maintenance work
scheduler.drain_pending_drop();
}
})
}
}
impl Spawner {
/// Spawn a future onto the thread pool
pub(crate) fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
where
F: Future + ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 0da23aad772afb22db8edf73ac0f034c5ada3bde | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0da23aad772afb22db8edf73ac0f034c5ada3bde/tokio/src/runtime/current_thread/mod.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:6 | if let Some(task) = task.run(&mut || Some(self.into())) {
unsafe {
self.schedule_local(task);
}
}
}
local
.park
.park_timeout(Duration::from_millis(0))
.ok()
.expect("failed to park");
}
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 0da23aad772afb22db8edf73ac0f034c5ada3bde | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0da23aad772afb22db8edf73ac0f034c5ada3bde/tokio/src/runtime/current_thread/mod.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:7 | fn next_task(&self, tick: u8) -> Option<Task<Self>> {
if 0 == tick % CHECK_REMOTE_INTERVAL {
self.next_remote_task().or_else(|| self.next_local_task())
} else {
self.next_local_task().or_else(|| self.next_remote_task())
}
}
fn next_local_task(&self) -> Option<Tas... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 0da23aad772afb22db8edf73ac0f034c5ada3bde | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0da23aad772afb22db8edf73ac0f034c5ada3bde/tokio/src/runtime/current_thread/mod.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:8 | let mut lock = self.remote_queue.lock().unwrap();
if lock.open {
lock.queue.push_back(task);
} else {
task.shutdown();
}
// while locked, call unpark
self.unpark.unpark();
drop(lock);
}
}
}
impl<P> Dr... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 0da23aad772afb22db8edf73ac0f034c5ada3bde | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0da23aad772afb22db8edf73ac0f034c5ada3bde/tokio/src/runtime/current_thread/mod.rs | 281 | 340 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:2 | //! # */
//! # }
//! ```
//!
//! # Examples
//!
//! Creating a new `Runtime` and running a future `f` until its completion and
//! returning its result.
//!
//! ```
//! use tokio::runtime::current_thread::Runtime;
//! use tokio::prelude::*;
//!
//! let mut runtime = Runtime::new().unwrap();
//!
//! // Use the runtime..... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 29e417c257c62ae95cfa73f6b56825b3f833dde8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/29e417c257c62ae95cfa73f6b56825b3f833dde8/tokio/src/runtime/current_thread/mod.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:3 | /// [`Runtime::run`] to wait for any other spawned futures to resolve.
pub fn block_on_all<F>(future: F) -> F::Output
where
F: Future,
{
let mut r = Runtime::new().expect("failed to start runtime on current thread");
let v = r.block_on(future);
r.run().expect("failed to resolve remaining futures");
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 29e417c257c62ae95cfa73f6b56825b3f833dde8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/29e417c257c62ae95cfa73f6b56825b3f833dde8/tokio/src/runtime/current_thread/mod.rs | 81 | 104 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:2 | //! # */
//! # }
//! ```
//!
//! # Examples
//!
//! Creating a new `Runtime` and running a future `f` until its completion and
//! returning its result.
//!
//! ```
//! use tokio::runtime::current_thread::Runtime;
//! use tokio::prelude::*;
//!
//! let mut runtime = Runtime::new().unwrap();
//!
//! // Use the runtime..... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 06c473e62842d257ed275497ce906710ea3f8e19 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/06c473e62842d257ed275497ce906710ea3f8e19/tokio/src/runtime/current_thread/mod.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:2 | //! # */
//! # }
//! ```
//!
//! # Examples
//!
//! Creating a new `Runtime` and running a future `f` until its completion and
//! returning its result.
//!
//! ```
//! use tokio::runtime::current_thread::Runtime;
//! use tokio::prelude::*;
//!
//! let mut runtime = Runtime::new().unwrap();
//!
//! // Use the runtime..... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | aac6998c22b393dd371befbc1aacc0c5f3951c1f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/aac6998c22b393dd371befbc1aacc0c5f3951c1f/tokio/src/runtime/current_thread/mod.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:3 | ///
/// This first creates a new [`Runtime`], and calls [`Runtime::block_on`] with the provided future,
/// which blocks the current thread until the provided future completes. It then calls
/// [`Runtime::run`] to wait for any other spawned futures to resolve.
pub fn block_on_all<F>(future: F) -> Result<F::Item, F::Er... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | aac6998c22b393dd371befbc1aacc0c5f3951c1f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/aac6998c22b393dd371befbc1aacc0c5f3951c1f/tokio/src/runtime/current_thread/mod.rs | 81 | 108 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:2 | //! # */
//! # }
//! ```
//!
//! # Examples
//!
//! Creating a new `Runtime` and running a future `f` until its completion and
//! returning its result.
//!
//! ```
//! use tokio::runtime::current_thread::Runtime;
//! use tokio::prelude::*;
//!
//! let mut runtime = Runtime::new().unwrap();
//!
//! // Use the runtime..... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/current_thread/mod.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:2 | //! # /*
//! runtime.run().unwrap();
//! # */
//! # }
//! ```
//!
//! # Examples
//!
//! Creating a new `Runtime` and running a future `f` until its completion and
//! returning its result.
//!
//! ```
//! use tokio::runtime::current_thread::Runtime;
//! use tokio::prelude::*;
//!
//! let mut runtime = Runtime::new().u... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 4ef736b9d5ac41b2548eaf7c59a00a63b2633ba4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4ef736b9d5ac41b2548eaf7c59a00a63b2633ba4/tokio/src/runtime/current_thread/mod.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/mod.rs:3 | /// Run the provided future to completion using a runtime running on the current thread.
///
/// This first creates a new [`Runtime`], and calls [`Runtime::block_on`] with the provided future,
/// which blocks the current thread until the provided future completes. It then calls
/// [`Runtime::run`] to wait for any oth... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/mod.rs | MIT | 4ef736b9d5ac41b2548eaf7c59a00a63b2633ba4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4ef736b9d5ac41b2548eaf7c59a00a63b2633ba4/tokio/src/runtime/current_thread/mod.rs | 81 | 110 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:1 | use crate::executor::current_thread::Handle as ExecutorHandle;
use crate::executor::current_thread::{self, CurrentThread};
use crate::net::driver::{self, Reactor};
use crate::runtime::current_thread::Builder;
use crate::timer::clock::{self, Clock};
use crate::timer::timer::{self, Timer};
use std::error::Error;
use std... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | c62ef2d232dea1535a8e22484fa2ca083f03e903 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c62ef2d232dea1535a8e22484fa2ca083f03e903/tokio/src/runtime/current_thread/runtime.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:2 | where
F: Future<Output = ()> + Send + 'static,
{
self.0.spawn(future)
}
/// Provides a best effort **hint** to whether or not `spawn` will succeed.
///
/// This function may return both false positives **and** false negatives.
/// If `status` returns `Ok`, then a call to `spawn`... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | c62ef2d232dea1535a8e22484fa2ca083f03e903 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c62ef2d232dea1535a8e22484fa2ca083f03e903/tokio/src/runtime/current_thread/runtime.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:3 | impl Error for RunError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
self.inner.source()
}
}
impl Runtime {
/// Returns a new runtime initialized with default configuration values.
pub fn new() -> io::Result<Runtime> {
Builder::new().build()
}
pub(super) fn new2(
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | c62ef2d232dea1535a8e22484fa2ca083f03e903 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c62ef2d232dea1535a8e22484fa2ca083f03e903/tokio/src/runtime/current_thread/runtime.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:4 | ///
/// # Examples
///
/// ```
/// use tokio::runtime::current_thread::Runtime;
///
/// # fn dox() {
/// // Create the runtime
/// let mut rt = Runtime::new().unwrap();
///
/// // Spawn a future onto the runtime
/// rt.spawn(async {
/// println!("now running on a work... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | c62ef2d232dea1535a8e22484fa2ca083f03e903 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c62ef2d232dea1535a8e22484fa2ca083f03e903/tokio/src/runtime/current_thread/runtime.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// remain pending in the `Runtime` instance. These futures will not run
/// until `block_on` or `run` is called again.
///
/// The caller is responsible for ensuring that other spawned futures
/// complete execution by calling `block_on` or `run`.
pub fn block_on<F: Future>(&mut self, f: F) -> F::O... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | c62ef2d232dea1535a8e22484fa2ca083f03e903 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c62ef2d232dea1535a8e22484fa2ca083f03e903/tokio/src/runtime/current_thread/runtime.rs | 161 | 206 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:1 | use crate::net::driver::{self, Reactor};
use crate::runtime::current_thread::Builder;
use crate::timer::clock::{self, Clock};
use crate::timer::timer::{self, Timer};
use tokio_executor::current_thread::Handle as ExecutorHandle;
use tokio_executor::current_thread::{self, CurrentThread};
use std::error::Error;
use std:... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 474befd23c368a34a5f45aab0f3945212109a803 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/474befd23c368a34a5f45aab0f3945212109a803/tokio/src/runtime/current_thread/runtime.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:2 | pub fn spawn<F>(&self, future: F) -> Result<(), tokio_executor::SpawnError>
where
F: Future<Output = ()> + Send + 'static,
{
self.0.spawn(future)
}
/// Provides a best effort **hint** to whether or not `spawn` will succeed.
///
/// This function may return both false positives *... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 474befd23c368a34a5f45aab0f3945212109a803 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/474befd23c368a34a5f45aab0f3945212109a803/tokio/src/runtime/current_thread/runtime.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:3 | }
impl Error for RunError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
self.inner.source()
}
}
impl Runtime {
/// Returns a new runtime initialized with default configuration values.
pub fn new() -> io::Result<Runtime> {
Builder::new().build()
}
pub(super) fn new2(
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 474befd23c368a34a5f45aab0f3945212109a803 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/474befd23c368a34a5f45aab0f3945212109a803/tokio/src/runtime/current_thread/runtime.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:4 | /// [mod]: index.html
///
/// # Examples
///
/// ```
/// use tokio::runtime::current_thread::Runtime;
///
/// # fn dox() {
/// // Create the runtime
/// let mut rt = Runtime::new().unwrap();
///
/// // Spawn a future onto the runtime
/// rt.spawn(async {
/// print... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 474befd23c368a34a5f45aab0f3945212109a803 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/474befd23c368a34a5f45aab0f3945212109a803/tokio/src/runtime/current_thread/runtime.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// have completed. Once the function returns, any uncompleted futures
/// remain pending in the `Runtime` instance. These futures will not run
/// until `block_on` or `run` is called again.
///
/// The caller is responsible for ensuring that other spawned futures
/// complete execution by calling `... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 474befd23c368a34a5f45aab0f3945212109a803 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/474befd23c368a34a5f45aab0f3945212109a803/tokio/src/runtime/current_thread/runtime.rs | 161 | 207 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:4 | /// [mod]: index.html
///
/// # Examples
///
/// ```
/// use tokio::runtime::current_thread::Runtime;
///
/// # fn dox() {
/// // Create the runtime
/// let mut rt = Runtime::new().unwrap();
///
/// // Spawn a future onto the runtime
/// rt.spawn(async {
/// print... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 227533d456fe32e48ffcd3796f1e6c8f9318b230 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/227533d456fe32e48ffcd3796f1e6c8f9318b230/tokio/src/runtime/current_thread/runtime.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// have completed. Once the function returns, any uncompleted futures
/// remain pending in the `Runtime` instance. These futures will not run
/// until `block_on` or `run` is called again.
///
/// The caller is responsible for ensuring that other spawned futures
/// complete execution by calling `... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 227533d456fe32e48ffcd3796f1e6c8f9318b230 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/227533d456fe32e48ffcd3796f1e6c8f9318b230/tokio/src/runtime/current_thread/runtime.rs | 161 | 210 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:6 | // The TaskExecutor is a fake executor that looks into the
// current single-threaded executor when used. This is a trick,
// because we need two mutable references to the executor (one
// to run the provided future, another to install as the default
// one). We use the f... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 227533d456fe32e48ffcd3796f1e6c8f9318b230 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/227533d456fe32e48ffcd3796f1e6c8f9318b230/tokio/src/runtime/current_thread/runtime.rs | 201 | 210 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:1 | use crate::runtime::current_thread::Builder;
use crate::timer::clock::{self, Clock};
use crate::timer::timer::{self, Timer};
use tokio_executor::current_thread::Handle as ExecutorHandle;
use tokio_executor::current_thread::{self, CurrentThread};
use tokio_net::driver::{self, Reactor};
use std::error::Error;
use std::... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | b8cee1a60ad99ef28ec494ae4230e2ef4399fcf9 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b8cee1a60ad99ef28ec494ae4230e2ef4399fcf9/tokio/src/runtime/current_thread/runtime.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:1 | use crate::runtime::current_thread::Builder;
use tokio_executor::current_thread::Handle as ExecutorHandle;
use tokio_executor::current_thread::{self, CurrentThread};
use tokio_net::driver::{self, Reactor};
use tokio_timer::clock::{self, Clock};
use tokio_timer::timer::{self, Timer};
use std::error::Error;
use std::fm... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | a791f4a758604768463d3ca2162b913dcea34c40 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/a791f4a758604768463d3ca2162b913dcea34c40/tokio/src/runtime/current_thread/runtime.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:3 | }
impl Error for RunError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
self.inner.source()
}
}
impl Runtime {
/// Returns a new runtime initialized with default configuration values.
pub fn new() -> io::Result<Runtime> {
Builder::new().build()
}
pub(super) fn new2(
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | f1f61a3b15d17767b12bfd8c0c5712db1b089b0b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/f1f61a3b15d17767b12bfd8c0c5712db1b089b0b/tokio/src/runtime/current_thread/runtime.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:4 | /// [mod]: index.html
///
/// # Examples
///
/// ```
/// #![feature(async_await)]
///
/// use tokio::runtime::current_thread::Runtime;
///
/// # fn dox() {
/// // Create the runtime
/// let mut rt = Runtime::new().unwrap();
///
/// // Spawn a future onto the runtime
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | f1f61a3b15d17767b12bfd8c0c5712db1b089b0b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/f1f61a3b15d17767b12bfd8c0c5712db1b089b0b/tokio/src/runtime/current_thread/runtime.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// Note that this function will **also** execute any spawned futures on the
/// current thread, but will **not** block until these other spawned futures
/// have completed. Once the function returns, any uncompleted futures
/// remain pending in the `Runtime` instance. These futures will not run
/// un... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | f1f61a3b15d17767b12bfd8c0c5712db1b089b0b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/f1f61a3b15d17767b12bfd8c0c5712db1b089b0b/tokio/src/runtime/current_thread/runtime.rs | 161 | 212 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:6 | clock::with_default(clock, || {
let _timer = timer::set_default(&timer_handle);
// The TaskExecutor is a fake executor that looks into the
// current single-threaded executor when used. This is a trick,
// because we need two mutable references to the executor (one
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | f1f61a3b15d17767b12bfd8c0c5712db1b089b0b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/f1f61a3b15d17767b12bfd8c0c5712db1b089b0b/tokio/src/runtime/current_thread/runtime.rs | 201 | 212 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:1 | use crate::runtime::current_thread::Builder;
use tokio_executor::current_thread::Handle as ExecutorHandle;
use tokio_executor::current_thread::{self, CurrentThread};
use tokio_net::{self, Reactor};
use tokio_timer::clock::{self, Clock};
use tokio_timer::timer::{self, Timer};
use std::error::Error;
use std::fmt;
use s... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 37131b21144de133628b54a1de500b623058f8cf | github | async-runtime | https://github.com/tokio-rs/tokio/blob/37131b21144de133628b54a1de500b623058f8cf/tokio/src/runtime/current_thread/runtime.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:2 | pub fn spawn<F>(&self, future: F) -> Result<(), tokio_executor::SpawnError>
where
F: Future<Output = ()> + Send + 'static,
{
self.0.spawn(future)
}
/// Provides a best effort **hint** to whether or not `spawn` will succeed.
///
/// This function may return both false positives *... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 37131b21144de133628b54a1de500b623058f8cf | github | async-runtime | https://github.com/tokio-rs/tokio/blob/37131b21144de133628b54a1de500b623058f8cf/tokio/src/runtime/current_thread/runtime.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:3 | }
impl Error for RunError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
self.inner.source()
}
}
impl Runtime {
/// Returns a new runtime initialized with default configuration values.
pub fn new() -> io::Result<Runtime> {
Builder::new().build()
}
pub(super) fn new2(
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 37131b21144de133628b54a1de500b623058f8cf | github | async-runtime | https://github.com/tokio-rs/tokio/blob/37131b21144de133628b54a1de500b623058f8cf/tokio/src/runtime/current_thread/runtime.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// Note that this function will **also** execute any spawned futures on the
/// current thread, but will **not** block until these other spawned futures
/// have completed. Once the function returns, any uncompleted futures
/// remain pending in the `Runtime` instance. These futures will not run
/// un... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 37131b21144de133628b54a1de500b623058f8cf | github | async-runtime | https://github.com/tokio-rs/tokio/blob/37131b21144de133628b54a1de500b623058f8cf/tokio/src/runtime/current_thread/runtime.rs | 161 | 212 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// Note that this function will **also** execute any spawned futures on the
/// current thread, but will **not** block until these other spawned futures
/// have completed. Once the function returns, any uncompleted futures
/// remain pending in the `Runtime` instance. These futures will not run
/// un... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 8538c25170240fa46313ffe9d4a9a2f9ba2536e5 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8538c25170240fa46313ffe9d4a9a2f9ba2536e5/tokio/src/runtime/current_thread/runtime.rs | 161 | 214 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:6 | clock::with_default(clock, || {
timer::with_default(&timer_handle, || {
// The TaskExecutor is a fake executor that looks into the
// current single-threaded executor when used. This is a trick,
// because we need two mutable references to the ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 8538c25170240fa46313ffe9d4a9a2f9ba2536e5 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8538c25170240fa46313ffe9d4a9a2f9ba2536e5/tokio/src/runtime/current_thread/runtime.rs | 201 | 214 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:1 | use crate::runtime::current_thread::Builder;
use tokio_executor::current_thread::Handle as ExecutorHandle;
use tokio_executor::current_thread::{self, CurrentThread};
use tokio_reactor::{self, Reactor};
use tokio_timer::clock::{self, Clock};
use tokio_timer::timer::{self, Timer};
use std::error::Error;
use std::fmt;
u... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 9de7083be89bde2e26ee5bc4f3333f5c8d13762d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9de7083be89bde2e26ee5bc4f3333f5c8d13762d/tokio/src/runtime/current_thread/runtime.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:2 | pub fn spawn<F>(&self, future: F) -> Result<(), tokio_executor::SpawnError>
where
F: Future<Output = ()> + Send + 'static,
{
self.0.spawn(future)
}
/// Provides a best effort **hint** to whether or not `spawn` will succeed.
///
/// This function may return both false positives *... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 9de7083be89bde2e26ee5bc4f3333f5c8d13762d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9de7083be89bde2e26ee5bc4f3333f5c8d13762d/tokio/src/runtime/current_thread/runtime.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:3 | }
impl Error for RunError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
self.inner.source()
}
}
impl Runtime {
/// Returns a new runtime initialized with default configuration values.
pub fn new() -> io::Result<Runtime> {
Builder::new().build()
}
pub(super) fn new2(
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 9de7083be89bde2e26ee5bc4f3333f5c8d13762d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9de7083be89bde2e26ee5bc4f3333f5c8d13762d/tokio/src/runtime/current_thread/runtime.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// Note that this function will **also** execute any spawned futures on the
/// current thread, but will **not** block until these other spawned futures
/// have completed. Once the function returns, any uncompleted futures
/// remain pending in the `Runtime` instance. These futures will not run
/// un... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 9de7083be89bde2e26ee5bc4f3333f5c8d13762d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9de7083be89bde2e26ee5bc4f3333f5c8d13762d/tokio/src/runtime/current_thread/runtime.rs | 161 | 214 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:1 | use crate::runtime::current_thread::Builder;
use tokio_current_thread::Handle as ExecutorHandle;
use tokio_current_thread::{self as current_thread, CurrentThread};
use tokio_executor;
use tokio_reactor::{self, Reactor};
use tokio_timer::clock::{self, Clock};
use tokio_timer::timer::{self, Timer};
use std::error::Error;... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 47e2ff48d9f1daac7dba9f136b24eed64c87cf40 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/47e2ff48d9f1daac7dba9f136b24eed64c87cf40/tokio/src/runtime/current_thread/runtime.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:2 | where
F: Future<Output = ()> + Send + 'static,
{
self.0.spawn(future)
}
/// Provides a best effort **hint** to whether or not `spawn` will succeed.
///
/// This function may return both false positives **and** false negatives.
/// If `status` returns `Ok`, then a call to `spawn`... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 47e2ff48d9f1daac7dba9f136b24eed64c87cf40 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/47e2ff48d9f1daac7dba9f136b24eed64c87cf40/tokio/src/runtime/current_thread/runtime.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:3 | impl Error for RunError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
self.inner.source()
}
}
impl Runtime {
/// Returns a new runtime initialized with default configuration values.
pub fn new() -> io::Result<Runtime> {
Builder::new().build()
}
pub(super) fn new2(
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 47e2ff48d9f1daac7dba9f136b24eed64c87cf40 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/47e2ff48d9f1daac7dba9f136b24eed64c87cf40/tokio/src/runtime/current_thread/runtime.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:4 | ///
/// # Examples
///
/// ```
/// #![feature(async_await)]
///
/// use tokio::runtime::current_thread::Runtime;
///
/// # fn dox() {
/// // Create the runtime
/// let mut rt = Runtime::new().unwrap();
///
/// // Spawn a future onto the runtime
/// rt.spawn(async {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 47e2ff48d9f1daac7dba9f136b24eed64c87cf40 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/47e2ff48d9f1daac7dba9f136b24eed64c87cf40/tokio/src/runtime/current_thread/runtime.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// current thread, but will **not** block until these other spawned futures
/// have completed. Once the function returns, any uncompleted futures
/// remain pending in the `Runtime` instance. These futures will not run
/// until `block_on` or `run` is called again.
///
/// The caller is responsibl... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 47e2ff48d9f1daac7dba9f136b24eed64c87cf40 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/47e2ff48d9f1daac7dba9f136b24eed64c87cf40/tokio/src/runtime/current_thread/runtime.rs | 161 | 213 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:6 | timer::with_default(&timer_handle, || {
// The TaskExecutor is a fake executor that looks into the
// current single-threaded executor when used. This is a trick,
// because we need two mutable references to the executor (one
// to run the ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 47e2ff48d9f1daac7dba9f136b24eed64c87cf40 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/47e2ff48d9f1daac7dba9f136b24eed64c87cf40/tokio/src/runtime/current_thread/runtime.rs | 201 | 213 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:3 | impl Error for RunError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
self.inner.source()
}
}
impl Runtime {
/// Returns a new runtime initialized with default configuration values.
pub fn new() -> io::Result<Runtime> {
Builder::new().build()
}
pub(super) fn new2(
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 003b4d8074e501f0185d0d38050219ec7b491bc3 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/003b4d8074e501f0185d0d38050219ec7b491bc3/tokio/src/runtime/current_thread/runtime.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:4 | ///
/// # Examples
///
/// ```rust,ignore
/// # use futures::{future, Future, Stream};
/// use tokio::runtime::current_thread::Runtime;
///
/// # fn dox() {
/// // Create the runtime
/// let mut rt = Runtime::new().unwrap();
///
/// // Spawn a future onto the runtime
/// ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 003b4d8074e501f0185d0d38050219ec7b491bc3 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/003b4d8074e501f0185d0d38050219ec7b491bc3/tokio/src/runtime/current_thread/runtime.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// Note that this function will **also** execute any spawned futures on the
/// current thread, but will **not** block until these other spawned futures
/// have completed. Once the function returns, any uncompleted futures
/// remain pending in the `Runtime` instance. These futures will not run
/// un... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 0651f0942722a76be1f330bc42e365511fc81635 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0651f0942722a76be1f330bc42e365511fc81635/tokio/src/runtime/current_thread/runtime.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:6 | // This will set the default handle and timer to use inside the closure
// and run the future.
tokio_reactor::with_default(&reactor_handle, &mut enter, |enter| {
clock::with_default(clock, || {
timer::with_default(&timer_handle, || {
// The TaskExecutor is... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 0651f0942722a76be1f330bc42e365511fc81635 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0651f0942722a76be1f330bc42e365511fc81635/tokio/src/runtime/current_thread/runtime.rs | 201 | 220 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:2 | where
F: Future<Output = ()> + Send + 'static,
{
self.0.spawn(future)
}
/// Provides a best effort **hint** to whether or not `spawn` will succeed.
///
/// This function may return both false positives **and** false negatives.
/// If `status` returns `Ok`, then a call to `spawn`... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 70eca184f0f52dd2d634b750bba698da9418ee5f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/70eca184f0f52dd2d634b750bba698da9418ee5f/tokio/src/runtime/current_thread/runtime.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:3 | impl Error for RunError {
fn description(&self) -> &str {
self.inner.description()
}
// FIXME(taiki-e): When the minimum support version of tokio reaches Rust 1.30,
// replace this with Error::source.
#[allow(deprecated)]
fn cause(&self) -> Option<&dyn Error> {
self.inner.cause(... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 70eca184f0f52dd2d634b750bba698da9418ee5f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/70eca184f0f52dd2d634b750bba698da9418ee5f/tokio/src/runtime/current_thread/runtime.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// completes.
///
/// This function can be used to synchronously block the current thread
/// until the provided `future` has resolved either successfully or with an
/// error. The result of the future is then returned from this function
/// call.
///
/// Note that this function will **also... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 70eca184f0f52dd2d634b750bba698da9418ee5f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/70eca184f0f52dd2d634b750bba698da9418ee5f/tokio/src/runtime/current_thread/runtime.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:6 | ref mut executor,
..
} = *self;
// Binds an executor to this thread
let mut enter = tokio_executor::enter().expect("Multiple executors at once");
// This will set the default handle and timer to use inside the closure
// and run the future.
tokio_reactor::wi... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 70eca184f0f52dd2d634b750bba698da9418ee5f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/70eca184f0f52dd2d634b750bba698da9418ee5f/tokio/src/runtime/current_thread/runtime.rs | 201 | 227 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:1 | use crate::runtime::current_thread::Builder;
use tokio_current_thread::Handle as ExecutorHandle;
use tokio_current_thread::{self as current_thread, CurrentThread};
use tokio_executor;
use tokio_reactor::{self, Reactor};
//use tokio_timer::clock::{self, Clock};
//use tokio_timer::timer::{self, Timer};
use std::error::Er... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 29e417c257c62ae95cfa73f6b56825b3f833dde8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/29e417c257c62ae95cfa73f6b56825b3f833dde8/tokio/src/runtime/current_thread/runtime.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:2 | pub fn spawn<F>(&self, future: F) -> Result<(), tokio_executor::SpawnError>
where
F: Future<Output = ()> + Send + 'static,
{
self.0.spawn(future)
}
/// Provides a best effort **hint** to whether or not `spawn` will succeed.
///
/// This function may return both false positives *... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 29e417c257c62ae95cfa73f6b56825b3f833dde8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/29e417c257c62ae95cfa73f6b56825b3f833dde8/tokio/src/runtime/current_thread/runtime.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:3 | }
impl Error for RunError {
fn description(&self) -> &str {
self.inner.description()
}
// FIXME(taiki-e): When the minimum support version of tokio reaches Rust 1.30,
// replace this with Error::source.
#[allow(deprecated)]
fn cause(&self) -> Option<&dyn Error> {
self.inner.cau... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 29e417c257c62ae95cfa73f6b56825b3f833dde8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/29e417c257c62ae95cfa73f6b56825b3f833dde8/tokio/src/runtime/current_thread/runtime.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// Runs the provided future, blocking the current thread until the future
/// completes.
///
/// This function can be used to synchronously block the current thread
/// until the provided `future` has resolved either successfully or with an
/// error. The result of the future is then returned from ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 29e417c257c62ae95cfa73f6b56825b3f833dde8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/29e417c257c62ae95cfa73f6b56825b3f833dde8/tokio/src/runtime/current_thread/runtime.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:6 | //ref clock,
ref mut executor,
..
} = *self;
// Binds an executor to this thread
let mut enter = tokio_executor::enter().expect("Multiple executors at once");
// This will set the default handle and timer to use inside the closure
// and run the future.
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 29e417c257c62ae95cfa73f6b56825b3f833dde8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/29e417c257c62ae95cfa73f6b56825b3f833dde8/tokio/src/runtime/current_thread/runtime.rs | 201 | 228 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:1 | use crate::runtime::current_thread::Builder;
use tokio_current_thread::{self as current_thread, CurrentThread};
use tokio_current_thread::Handle as ExecutorHandle;
use tokio_executor;
use tokio_reactor::{self, Reactor};
//use tokio_timer::clock::{self, Clock};
//use tokio_timer::timer::{self, Timer};
use std::fmt;
use ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 06c473e62842d257ed275497ce906710ea3f8e19 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/06c473e62842d257ed275497ce906710ea3f8e19/tokio/src/runtime/current_thread/runtime.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:2 | pub fn spawn<F>(&self, future: F) -> Result<(), tokio_executor::SpawnError>
where F: Future<Output = ()> + Send + 'static {
self.0.spawn(future)
}
/// Provides a best effort **hint** to whether or not `spawn` will succeed.
///
/// This function may return both false positives **and** false ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 06c473e62842d257ed275497ce906710ea3f8e19 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/06c473e62842d257ed275497ce906710ea3f8e19/tokio/src/runtime/current_thread/runtime.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:3 | impl Error for RunError {
fn description(&self) -> &str {
self.inner.description()
}
// FIXME(taiki-e): When the minimum support version of tokio reaches Rust 1.30,
// replace this with Error::source.
#[allow(deprecated)]
fn cause(&self) -> Option<&dyn Error> {
self.inner.cause(... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 06c473e62842d257ed275497ce906710ea3f8e19 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/06c473e62842d257ed275497ce906710ea3f8e19/tokio/src/runtime/current_thread/runtime.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// This function can be used to synchronously block the current thread
/// until the provided `future` has resolved either successfully or with an
/// error. The result of the future is then returned from this function
/// call.
///
/// Note that this function will **also** execute any spawned futu... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 06c473e62842d257ed275497ce906710ea3f8e19 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/06c473e62842d257ed275497ce906710ea3f8e19/tokio/src/runtime/current_thread/runtime.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:6 | } = *self;
// Binds an executor to this thread
let mut enter = tokio_executor::enter().expect("Multiple executors at once");
// This will set the default handle and timer to use inside the closure
// and run the future.
tokio_reactor::with_default(&reactor_handle, &mut enter, |... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | 06c473e62842d257ed275497ce906710ea3f8e19 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/06c473e62842d257ed275497ce906710ea3f8e19/tokio/src/runtime/current_thread/runtime.rs | 201 | 225 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:1 | use crate::runtime::current_thread::Builder;
use futures::{future, Future};
use tokio_current_thread::{self as current_thread, CurrentThread};
use tokio_current_thread::Handle as ExecutorHandle;
use tokio_executor;
use tokio_reactor::{self, Reactor};
use tokio_timer::clock::{self, Clock};
use tokio_timer::timer::{self,... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/current_thread/runtime.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:2 | }
/// Provides a best effort **hint** to whether or not `spawn` will succeed.
///
/// This function may return both false positives **and** false negatives.
/// If `status` returns `Ok`, then a call to `spawn` will *probably*
/// succeed, but may fail. If `status` returns `Err`, a call to `spawn` w... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/current_thread/runtime.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:3 | Handle::spawn(self, future)
}
}
/// Error returned by the `run` function.
#[derive(Debug)]
pub struct RunError {
inner: current_thread::RunError,
}
impl fmt::Display for RunError {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(fmt, "{}", self.inner)
}
}
impl Error for Ru... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/current_thread/runtime.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:4 | {
Runtime {
reactor_handle,
timer_handle,
clock,
executor,
}
}
/// Get a new handle to spawn futures on the single-threaded Tokio runtime
///
/// Different to the runtime itself, the handle can be sent to different
/// threads.
pub... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/current_thread/runtime.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:5 | /// ```
///
/// # Panics
///
/// This function panics if the spawn fails. Failure occurs if the executor
/// is currently at capacity and is unable to spawn a new future.
pub fn spawn<F>(&mut self, future: F) -> &mut Self
where F: Future<Item = (), Error = ()> + 'static,
{
self.e... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/current_thread/runtime.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:6 | /// spawned futures have completed.
pub fn run(&mut self) -> Result<(), RunError> {
self.enter(|executor| executor.run())
.map_err(|e| RunError {
inner: e,
})
}
fn enter<F, R>(&mut self, f: F) -> R
where F: FnOnce(&mut current_thread::Entered<'_, Timer<Re... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0/tokio/src/runtime/current_thread/runtime.rs | 201 | 242 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:1 | use tokio_current_thread::{self as current_thread, CurrentThread};
use tokio_current_thread::Handle as ExecutorHandle;
use runtime::current_thread::Builder;
use tokio_reactor::{self, Reactor};
use tokio_timer::clock::{self, Clock};
use tokio_timer::timer::{self, Timer};
use tokio_executor;
use futures::{future, Futur... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | b1172f8074b381b543ff15e23e3092fc5dc6de7d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b1172f8074b381b543ff15e23e3092fc5dc6de7d/tokio/src/runtime/current_thread/runtime.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/current_thread/runtime.rs:2 | pub fn spawn<F>(&self, future: F) -> Result<(), tokio_executor::SpawnError>
where F: Future<Item = (), Error = ()> + Send + 'static {
self.0.spawn(future)
}
/// Provides a best effort **hint** to whether or not `spawn` will succeed.
///
/// This function may return both false positives **an... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/current_thread/runtime.rs | MIT | b1172f8074b381b543ff15e23e3092fc5dc6de7d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b1172f8074b381b543ff15e23e3092fc5dc6de7d/tokio/src/runtime/current_thread/runtime.rs | 41 | 100 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.