use crate Task;
use ;
use Future;
pub static GLOBAL_EXECUTOR: = new;
thread_local!
/// Runs the global and the local executor on the current thread
///
/// Note: this calls `async_io::block_on` underneath.
///
/// # Examples
///
/// ```
/// let task = async_global_executor::spawn(async {
/// 1 + 2
/// });
/// async_global_executor::block_on(async {
/// assert_eq!(task.await, 3);
/// });
/// ```
/// Spawns a task onto the multi-threaded global executor.
///
/// # Examples
///
/// ```
/// # use futures_lite::future;
///
/// let task1 = async_global_executor::spawn(async {
/// 1 + 2
/// });
/// let task2 = async_global_executor::spawn(async {
/// 3 + 4
/// });
/// let task = future::zip(task1, task2);
///
/// async_global_executor::block_on(async {
/// assert_eq!(task.await, (3, 7));
/// });
/// ```
/// Spawns a task onto the local executor.
///
///
/// The task does not need to be `Send` as it will be spawned on the same thread.
///
/// # Examples
///
/// ```
/// # use futures_lite::future;
///
/// let task1 = async_global_executor::spawn_local(async {
/// 1 + 2
/// });
/// let task2 = async_global_executor::spawn_local(async {
/// 3 + 4
/// });
/// let task = future::zip(task1, task2);
///
/// async_global_executor::block_on(async {
/// assert_eq!(task.await, (3, 7));
/// });
/// ```
/// Runs blocking code on a thread pool.
///
/// # Examples
///
/// Read the contents of a file:
///
/// ```no_run
/// # async_global_executor::block_on(async {
/// let contents = async_global_executor::spawn_blocking(|| std::fs::read_to_string("file.txt")).await?;
/// # std::io::Result::Ok(()) });
/// ```
///
/// Spawn a process:
///
/// ```no_run
/// use std::process::Command;
///
/// # async_global_executor::block_on(async {
/// let out = async_global_executor::spawn_blocking(|| Command::new("dir").output()).await?;
/// # std::io::Result::Ok(()) });
/// ```