6 releases

0.1.4 Aug 24, 2018
0.1.3 Aug 7, 2018
0.1.2 Mar 30, 2018
0.0.0 Feb 1, 2018

#5 in Asynchronous

Download history 21596/week @ 2018-09-02 22642/week @ 2018-09-09 23991/week @ 2018-09-16 25346/week @ 2018-09-23 26977/week @ 2018-09-30 29575/week @ 2018-10-07 28702/week @ 2018-10-14 28758/week @ 2018-10-21 30647/week @ 2018-10-28 32459/week @ 2018-11-04 29581/week @ 2018-11-11 32262/week @ 2018-11-18 25579/week @ 2018-11-25

74,527 downloads per month
Used in 1,537 crates (31 directly)

MIT license

32KB
369 lines

tokio-executor

Task execution related traits and utilities.

Documentation

Overview

In the Tokio execution model, futures are lazy. When a future is created, no work is performed. In order for the work defined by the future to happen, the future must be submitted to an executor. A future that is submitted to an executor is called a "task".

The executor is responsible for ensuring that [Future::poll] is called whenever the task is [notified]. Notification happens when the internal state of a task transitions from "not ready" to ready. For example, a socket might have received data and a call to read will now be able to succeed.

This crate provides traits and utilities that are necessary for building an executor, including:

  • The Executor trait describes the API for spawning a future onto an executor.

  • enter marks that the current thread is entering an execution context. This prevents a second executor from accidentally starting from within the context of one that is already running.

  • DefaultExecutor spawns tasks onto the default executor for the current context.

  • Park abstracts over blocking and unblocking the current thread.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tokio by you, shall be licensed as MIT, without any additional terms or conditions.

Dependencies

~462KB