A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.rs/rdkafka/*/rdkafka/util/trait.AsyncRuntime.html below:

AsyncRuntime in rdkafka::util - Rust

pub trait AsyncRuntime:
    Send
    + Sync
    + 'static {
    type Delay: Future<Output = ()> + Send;

    // Required methods
    fn spawn<T>(task: T)
       where T: Future<Output = ()> + Send + 'static;
    fn delay_for(duration: Duration) -> Self::Delay;
}
Expand description

An abstraction over asynchronous runtimes.

There are several asynchronous runtimes available for Rust. By default rust-rdkafka uses Tokio, via the TokioRuntime, but it has pluggable support for any runtime that can satisfy this trait.

For an example of using the smol runtime with rust-rdkafka, see the runtime_smol example.

For an example of using the async-std runtime with rust-rdkafka, see the runtime_async_std example.

Source

Spawns an asynchronous task.

The task should be be polled to completion, unless the runtime exits first. With some runtimes this requires an explicit “detach” step.

Source

Constructs a future that will resolve after duration has elapsed.

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Source§

Available on crate feature naive-runtime only.

Source§

Available on crate feature tokio only.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4