Module tarantool::fiber::async

source ·
Expand description

Async runtime based on Tarantool fibers. Also includes sycnhronization primitives and useful traits for working with futures.

Use block_on to start the runtime.

Example

async fn foo() {
    // do something
}

use tarantool::fiber;
fiber::block_on(async {
    foo().await;
    // ... some other code
});

See also:

Re-exports

Modules

  • See Mutex for examples and docs.
  • A one-shot channel is used for sending a single message between asynchronous tasks. The channel function is used to create a Sender and Receiver handle pair that form the channel.
  • Allows a future to execute for a maximum amount of time.
  • A single-producer, multi-consumer channel that only retains the last sent value.

Structs

  • A wrapper around a future which has on_drop behavior. See on_drop.
  • Error that happens on the receiver side of the channel.

Traits

  • Futures implementing this trait can attach a closure which will be executed when the future is dropped. See on_drop.

Functions

  • Runs a future to completion on the fiber-based runtime. This is the async runtime’s entry point.
  • Adds a closure to the future, which will be executed when the future is dropped. This can be useful to cleanup external resources on future cancelation or completion.
  • An async friendly version of fiber::sleep. Prefer this version when working in async contexts.