Age | Commit message (Collapse) | Author |
|
* Refactor proc macros, add more knobs
* make macros work with rt-core
|
|
|
|
This allows the `benches` crate to depend on `tokio` with all feature
flags. This is a similar strategy used for `examples`.
|
|
Previously, thread-locals used by the various drivers were situated
with the driver code. This resulted in state being spread out and many
thread-locals being required to run a runtime.
This PR coalesces the thread-locals into a single struct.
|
|
|
|
|
|
Storing a `Runtime` value in a thread-local resulted in a panic due to
the inability to access the parker.
This fixes the bug by skipping parking if it fails. In general, there
isn't much that we can do besides not parking.
Fixes #593
|
|
also add an async version of `fs::canonicalize`
|
|
|
|
|
|
Nested spawn_blocking calls would result in a panic due to the necessary
context not being setup. This patch sets the blocking pool context from
within a blocking pool.
Fixes #1982
|
|
`cargo fmt` has a bug where it does not format modules scoped with
feature flags.
|
|
|
|
`ToSocketAddrs` is a sealed trait pending changes in Rust that will allow
defining async trait fns. Until then, `net::lookup_host` is provided as a way
to convert a `T: ToSocketAddrs` into `SocketAddr`s.
|
|
|
|
Adds `StreamExt::filter` and `StreamExt::filter_map`.
|
|
|
|
|
|
This fixes an API compatibility regression when `AsyncSeek` was added.
Fixes: #1989
|
|
Also includes:
- `tokio-macros` v0.2.1
|
|
Introduces `StreamExt` trait. This trait will be used to add utility functions
to make working with streams easier. This patch includes two functions:
* `next`: a future returning the item in the stream.
* `map`: transform each item in the stream.
|
|
As there is currently only one variant, make the error type an opaque
struct.
|
|
|
|
`num_threads` is deprecated. Instead, `core_threads` and `max_threads` are
introduced. `core_threads` specifies the number of "always on" threads used
for the async task executor and `max_threads` specifies the maximum number
of threads that the runtime may spawn.
|
|
Adds a broadcast channel implementation. A broadcast channel is a
multi-producer, multi-consumer channel where each consumer receives a
clone of every value sent. This is useful for implementing pub / sub
style patterns.
Implemented as a ring buffer, a Vec of the specified capacity is
allocated on initialization of the channel. Values are pushed into
slots.
When the channel is full, a send overwrites the oldest value. Receivers
detect this and return an error on the next call to receive. This
prevents unbounded buffering and does not make the channel vulnerable to
the slowest consumer.
Closes: #1585
|
|
Provide an asynchronous Semaphore implementation. This is useful for
synchronizing concurrent access to a shared resource.
|
|
|
|
The blocking task queue was not explicitly drained as part of the
blocking pool shutdown logic. It was originally assumed that the
contents of the queue would be dropped when the blocking pool structure
is dropped. However, tasks must be explicitly shutdown, so we must drain
the queue can call `shutdown` on each task.
Fixes #1970, #1946
|
|
|
|
Calls to tasks should not be nested. Currently, while a task is being
executed and the runtime is shutting down, a call to wake() can result
in the wake target to be dropped. This, in turn, results in the drop
handler being called.
If the user holds a ref cell borrow, a mutex guard, or any such value,
dropping the task inline can result in a deadlock.
The fix is to permit tasks to be scheduled during the shutdown process
and dropping the tasks once they are popped from the queue.
Fixes #1929, #1886
|
|
|
|
|
|
Closes #1932
|
|
|
|
|
|
|
|
|
|
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.
|
|
Co-authored-by: Taiki Endo <te316e89@gmail.com>
|
|
|
|
|
|
|
|
|
|
Includes a `Mutex` bug fix
|
|
The bug caused the mutex to reach a state where it is locked and cannot be unlocked.
Fixes #1898
|
|
|
|
|
|
The `process_socket` is hidden from the user which makes the example
fail to compile if copied by the reader.
|
|
|
|
|