summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-12-16chore: add roadmap (#1965)Kelly Thomas Kline
2019-12-14Fix typo in sync documentation (#1942)Vlad-Shcherbina
2019-12-14Enable the `full` feature when compiled for the playground (#1960)Jake Goulding
Closes #1932
2019-12-13time: stream throttle (#1949)Artem Vorotnikov
2019-12-13chore: remove benches and fix/work around clippy lints (#1952)Artem Vorotnikov
2019-12-13macros: inherit visibilityDouman
2019-12-13Re-enable writev support in TcpStreams (#1956)Sean McArthur
2019-12-13chore: fix warning in tokio-util tests (#1955)Carl Lerche
`bytes` added a warning when using a fn that resulted in a useless clone.
2019-12-12Fix typo with updated docs (#1920)Mathspy
I think this is a typo
2019-12-11chore: fix the outdated example in README (#1930)nickelc
2019-12-11chore: fix thread_pool benchmarks (#1947)Carl Lerche
Update the rotted thread_pool benchmarks. These benchmarks are not the greatest, but as of now it is all we have for micro benchmarks. Adds a little yielding in the parker as it helps a bit.
2019-12-10io: add AsyncSeek trait (#1924)Michael Howell
Co-authored-by: Taiki Endo <te316e89@gmail.com>
2019-12-10Add Mutex::try_lock and (Unbounded)Receiver::try_recv (#1939)Michael P. Jung
2019-12-10fix spawn function documentation (#1940)Juan Alvarez
2019-12-09sync::Mutex: Fix typo in documentation (#1934)Danilo Bargen
2019-12-09sync::Mutex: Add note about the absence of poisoning (#1933)Danilo Bargen
2019-12-06chore: prepare v0.2.4 release (#1917)Carl Lerche
Includes a `Mutex` bug fix
2019-12-06sync: fix Mutex when lock future dropped before complete (#1902)Michael P. Jung
The bug caused the mutex to reach a state where it is locked and cannot be unlocked. Fixes #1898
2019-12-06doc: expand on runtime / spawn docs (#1914)Carl Lerche
2019-12-06prepare v0.2.3 release (#1912)Carl Lerche
2019-12-06doc: fix TcpListener example to compile (#1911)Carl Lerche
The `process_socket` is hidden from the user which makes the example fail to compile if copied by the reader.
2019-12-06Close markdown (#1910)Jeremy Kolb
2019-12-05time: impl From between std / tokio Instants (#1904)Steven Fackler
2019-12-05task: fix `LocalSet` failing to poll all local futures (#1905)Eliza Weisman
Currently, a `LocalSet` does not notify the `LocalFuture` again at the end of a tick. This means that if we didn't poll every task in the run queue during that tick (e.g. there are more than 61 tasks enqueued), those tasks will not be polled. This commit fixes this issue by changing `local::Scheduler::tick` to return whether or not the local future needs to be notified again, and waking the task if so. Fixes #1899 Fixes #1900 Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-12-04time: Remove `HandlePriv` (#1896)Kevin Leimkuhler
## Motivation #1800 removed the lazy binding of `Delay`s to timers. With the removal of the logic required for that, `HandlePriv` is no longer needed. This PR removes the use of `HandlePriv`. A `TODO` was also removed that would panic if when registering a new `Delay` the current timer handle was full. That has been fixed to now immediately transition that `Delay` to an error state that can be handled in a similar way to other error states. Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
2019-12-04task: fix infinite loop when dropping a `LocalSet` (#1892)Eliza Weisman
## Motivation There's currently an issue in `task::LocalSet` where dropping the local set can result in an infinite loop if a task running in the local set is notified from outside the local set (e.g. by a timer). This was reported in issue #1885. This issue exists because the `Drop` impl for `task::local::Scheduler` does not drain the queue of tasks notified externally, the way the basic scheduler does. Instead, only the local queue is drained, leaving some tasks in place. Since these tasks are never removed, the loop that continues trying to cancel tasks until the owned task list is totally empty continues infinitely. I think this issue was due to the `Drop` impl being written before a remote queue was added to the local scheduler, and the need to close the remote queue as well was overlooked. ## Solution This branch solves the problem by clearing the local scheduler's remote queue as well as the local one. I've added a test that reproduces the behavior. The test fails on master and passes after this change. In addition, this branch factors out the common task queue logic in the basic scheduler runtime and the `LocalSet` struct in `tokio::task`. This is because as more work was done on the `LocalSet`, it has gotten closer and closer to the basic scheduler in behavior, and factoring out the shared code reduces the risk of errors caused by `LocalSet` not doing something that the basic scheduler does. The queues are now encapsulated by a `MpscQueues` struct in `tokio::task::queue` (crate-public). As a follow-up, I'd also like to look into changing this type to use the same remote queue type as the threadpool (a linked list). In particular, I noticed the basic scheduler has a flag that indicates the remote queue has been closed, which is set when dropping the scheduler. This prevents tasks from being added after the scheduler has started shutting down, stopping a potential task leak. Rather than duplicating this code in `LocalSet`, I thought it was probably better to factor it out into a shared type. There are a few cases where there are small differences in behavior, though, so there is still a need for separate types implemented _using_ the new `MpscQueues` struct. However, it should cover most of the identical code. Note that this diff is rather large, due to the refactoring. However, the actual fix for the infinite loop is very simple. It can be reviewed on its own by looking at commit 4f46ac6. The refactor is in a separate commit, with the SHA 90b5b1f. Fixes #1885 Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-12-04Make JoinError Sync (#1888)Artem Vorotnikov
* Make JoinError Sync * Move Mutex inside JoinError internals, hide its constructors * Deprecate JoinError constructors, fix internal usages
2019-12-03remove io workarounds from example (#1891)Juan Alvarez
This PR removes no longer needed io workarounds from connect example.
2019-12-03Fixing minor spelling mistake in task docs (#1889)Christopher Coverdale
2019-12-03Add unit tests for tokio::File::AsRaw{Fd,Handle} for Unix and Windows. (#1890)Xinkai Chen
Supersedes #1640.
2019-12-02examples: fix tinyhttp (#1884)baizhenxuan
2019-12-02task: relax 'static bound in `LocalSet::block_on` (#1882)Eliza Weisman
## Motivation Currently, `tokio::task::LocalSet`'s `block_on` method requires the future to live for the 'static lifetime. However, this bound is not required — the future is wrapped in a `LocalFuture`, and then passed into `Runtime::block_on`, which does _not_ require a `'static` future. This came up while updating `tokio-compat` to work with version 0.2. To mimic the behavior of `tokio` 0.1's `current_thread::Runtime::run`, we want to be able to have a runtime block on the `recv` future from an mpsc channel indicating when the runtime is idle. To support `!Send` futures, as the old `current_thread::Runtime` did, we must do so inside of a `LocalSet`. However, with the current bounds, we cannot await an `mpsc::Receiver`'s `recv` future inside the `LocalSet::block_on` call. ## Solution This branch removes the unnecessary `'static` bound. Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-12-02io: add async fns for reading / writing bufs (#1881)Carl Lerche
Adds `read_buf` and `write_buf` which work with `T: BufMut` and `T: Buf` respectively. This adds an easy API for using the buffer traits provided by `bytes.
2019-12-01blocking: fix `spawn_blocking` after shutdown (#1875)Carl Lerche
The task handle needs to be shutdown explicitly and not dropped. Closes #1853
2019-12-01doc: fix documented feature flags for tokio::task (#1876)Carl Lerche
Some feature flags are missing and some are duplicated. Closes #1836
2019-12-01sync: expand oneshot docs and `TryRecvError` (#1874)Carl Lerche
`oneshot::Receiver::try_recv` does not provide any information as to the reason **why** receiving failed. The two cases are that the channel is empty or that the channel closed. `TryRecvError` is changed to be an enum of those two cases. This is backwards compatible as `TryRecvError` was an opaque struct. This also expands on `oneshot` API documentation, adding details and examples. Closes #1872
2019-11-30process: rewrite and simplify the issue_42 test (#1871)Ivan Petkov
2019-11-30io: read/write big-endian numbers (#1863)Carl Lerche
Provide convenience methods for encoding and decoding big-endian numbers on top of asynchronous I/O streams. Only primitive types are provided (24 and 48 bit numbers are omitted). In general, using these methods won't be the fastest way to do encoding/decoding with asynchronous byte streams, but they help to get simple things working fast.
2019-11-30doc: improve AsyncBufReadExt API documentation (#1868)Carl Lerche
Remove "old" docs that were left over during a rewrite, add examples and additional details.
2019-11-30net: expose `TcpStream::poll_peek` (#1864)Carl Lerche
This used to be exposed in 0.1, but was switched to private during the upgrade. The `async fn` is sufficient for many, but not all cases. Closes #1556
2019-11-30doc: expand `mpsc::Sender::send` API documentation (#1865)Carl Lerche
Includes more description, lists errors, and examples. Closes #1579
2019-11-30doc: add API docs for AsyncBufReadExt::read_line (#1866)Carl Lerche
Include more details and an example. Closes #1592
2019-11-29chore: prepare v0.2.2 release (#1857)Ivan Petkov
2019-11-29rt: fix `basic_scheduler` notification bug (#1861)Carl Lerche
The "global executor" thread-local is to track where to spawn new tasks, **not** which scheduler is active on the current thread. This fixes a bug with scheduling tasks on the basic_scheduler by tracking the currently active basic_scheduler with a dedicated thread-local variable. Fixes: #1851
2019-11-29docs: Mention features for basic_scheduler, threaded_scheduler (#1858)Ömer Sinan Ağacan
Fixes #1829
2019-11-28fs: add File::into_std and File::try_into_std methods (#1856)Bartek Iwańczuk
In version 0.1 there was File::into_std method that destructured tokio_fs::File into std::fs:File. That method was lacking in version 0.2. Fixes: #1852
2019-11-28signal: update documentation with caveats (#1854)Ivan Petkov
2019-11-28Implement Stream for signal::unix::Signal (#1849)Ömer Sinan Ağacan
Refs #1848
2019-11-27task: fix panic when dropping `LocalSet` (#1843)Eliza Weisman
It turns out that the `Scheduler::release` method on `LocalSet`'s `Scheduler` *is* called, when the `Scheduler` is dropped with tasks still running. Currently, that method is `unreachable!`, which means that dropping a `LocalSet` with tasks running will panic. This commit fixes the panic, by pushing released tasks to `pending_drop`. This is the same as `BasicScheduler`. Fixes #1842
2019-11-27net: fix ucred for illumos/solaris (#1772)Michael Zeller