#callback #music-player #manage #create #mutation #async #task

async-callback-manager

Library that provides an interface to create and manage asynchronous callbacks in Rust. Dependency of youtui music player.

5 releases

new 0.0.5 Feb 17, 2025
0.0.4 Feb 4, 2025
0.0.3 Dec 15, 2024
0.0.2 Nov 18, 2024
0.0.1 Nov 18, 2024

#540 in Audio

Download history 358/week @ 2024-11-18 32/week @ 2024-11-25 17/week @ 2024-12-02 111/week @ 2024-12-09 97/week @ 2024-12-16 26/week @ 2024-12-23 4/week @ 2024-12-30 10/week @ 2025-01-06 8/week @ 2025-01-13 2/week @ 2025-01-20 14/week @ 2025-01-27 186/week @ 2025-02-03 17/week @ 2025-02-10

220 downloads per month
Used in youtui

MIT license

38KB
950 lines

About

async-callback-manager is a crate designed to help you manage an asynchronous callback pattern when developing Rust UI.

This is initially designed as a dependency of the youtui music player, however could have wider applicability.

Basic usage

The AsyncCallbackManager should live with your event loop, and can produce a stream of events corresponding to a component callback or an asynchronous task.

From the AsyncCallbackManager you can create AsyncCallbackSenders that allow you to log asynchronous callbacks and receive their replies as a list of state mutations to be applied.

Examples

A runnable example using ratatui is provided in the examples directory. cargo r --example=ratatui_example.

Dependencies

~6–18MB
~225K SLoC