Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
99: Bump tokio from 0.2.4 to 0.2.6 r=sopium a=dependabot-preview[bot] Bumps [tokio](/~https://github.com/tokio-rs/tokio) from 0.2.4 to 0.2.6. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="/~https://github.com/tokio-rs/tokio/releases">tokio's releases</a>.</em></p> <blockquote> <h2>Tokio v0.2.6</h2> <p>This release fixes an API regression introduced as part of v0.2.5.</p> <h3>Fixes</h3> <ul> <li><code>fs::File::seek</code> API regression (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/1991">#1991</a>).</li> </ul> <h2>Tokio v0.2.5</h2> <p>Includes new APIs, utilities, and fixes. Some highlights:</p> <h3><code>tokio::sync::broadcast</code></h3> <p>A multi-producer, multi-consumer channel where each sent value is sent to <strong>all</strong> consumers (fan-out). The channel is <strong>bounded</strong> and when consumers lag, they will receive an error indicating they have lagged too far behind.</p> <pre lang="rust"><code>use tokio::sync::broadcast; <p>#[tokio::main] async fn main() { let (tx, mut rx1) = broadcast::channel(16); let mut rx2 = tx.subscribe();</p> <pre><code>tokio::spawn(async move { assert_eq!(rx1.recv().await.unwrap(), 10); assert_eq!(rx1.recv().await.unwrap(), 20); }); tokio::spawn(async move { assert_eq!(rx2.recv().await.unwrap(), 10); assert_eq!(rx2.recv().await.unwrap(), 20); }); tx.send(10).unwrap(); tx.send(20).unwrap(); </code></pre> <p>} </code></pre></p> <p>Senders never block. When the channel is full, the oldest value still held by the channel is overwritten. This tends to be the desired behavior in order to prevent slow consumers from blocking the entire system. However, you can use a <code>Semaphore</code> (also added in this release) to ensure that all consumers see all messages.</p> <h3><code>tokio::sync::Semaphore</code></h3> <p>A counting synchronization primitive. It is used to limit a critical section to 1 or more concurrent tasks. For example, assume we wish to limit the number of in-flight database queries, we could do something like:</p> <pre lang="rust"><code>struct MyDbClient { db: MyDbHandle, semaphore: tokio::sync:Semaphore, } <p>async fn query(client: &MyDbClient, query: Query) -> QueryResult { let _permit = client.semaphore.acquire().await; </tr></table> ... (truncated) </code></pre></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="/~https://github.com/tokio-rs/tokio/commit/248bf2144f4fa2792f430acec67bd5763236fabd"><code>248bf21</code></a> prepare v0.2.6 release (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/1995">#1995</a>)</li> <li><a href="/~https://github.com/tokio-rs/tokio/commit/93ab70a9a0eca676ef718f02482d3fa0bdd760fd"><code>93ab70a</code></a> fs: add deprecated fs::File::seek fn (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/1991">#1991</a>)</li> <li><a href="/~https://github.com/tokio-rs/tokio/commit/58b5abdb99f113152e9953b0576c4c2fd0aaab99"><code>58b5abd</code></a> update connect example (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/1787">#1787</a>)</li> <li><a href="/~https://github.com/tokio-rs/tokio/commit/2d78cfe56ac14f384e26278951b52099d33bd797"><code>2d78cfe</code></a> chore: prepare v0.2.5 release (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/1984">#1984</a>)</li> <li><a href="/~https://github.com/tokio-rs/tokio/commit/4c645866ef4ea5b0ef8c7852281a09b2f96d969b"><code>4c64586</code></a> stream: add <code>next</code> and <code>map</code> utility fn (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/1962">#1962</a>)</li> <li><a href="/~https://github.com/tokio-rs/tokio/commit/b0836ece7aa5219e9e40355d0eb784baffc7b6c6"><code>b0836ec</code></a> sync: encapsulate TryLockError variants (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/1980">#1980</a>)</li> <li><a href="/~https://github.com/tokio-rs/tokio/commit/0c0f68201037af3fbaac6ca29a9806e392593d89"><code>0c0f682</code></a> Improve runtime threading options docs</li> <li><a href="/~https://github.com/tokio-rs/tokio/commit/b24ad9fe861ce01add2c6533149f643e38537f59"><code>b24ad9f</code></a> rt: add configuration for core threads and max threads (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/1977">#1977</a>)</li> <li><a href="/~https://github.com/tokio-rs/tokio/commit/7c010ed030d0084d38451bbebf727c6695c2dbac"><code>7c010ed</code></a> sync: add broadcast channel (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/1943">#1943</a>)</li> <li><a href="/~https://github.com/tokio-rs/tokio/commit/42c942de1433c37946f81d185459b8ee54928d3d"><code>42c942d</code></a> Fix ROADMAP link (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/1981">#1981</a>)</li> <li>Additional commits viewable in <a href="/~https://github.com/tokio-rs/tokio/compare/tokio-0.2.4...tokio-0.2.6">compare view</a></li> </ul> </details> <br /> [](https://dependabot.com/compatibility-score.html?dependency-name=tokio&package-manager=cargo&previous-version=0.2.4&new-version=0.2.6) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
- Loading branch information