6个版本
| 0.3.0 | 2023年1月11日 |
|---|---|
| 0.2.0 | 2021年3月26日 |
| 0.1.1 | 2020年11月4日 |
962 在 HTTP服务器
每月23次下载
115KB
2K SLoC
actix-storage-hashmap
本crate提供了基于std lib的hashmap实现的actix-storage。
请参阅actix-storage crate文档以获取使用和用例的详细信息。
此crate中有2种不同的实现者
HashMapStore
HashMapStore是一个简单的存储,没有过期功能。
HashMapActor
HashMapActor是可在actor功能下使用的完整expiry_store实现。
实现细节
HashMapActor是在actix的arbiter中运行的AsyncActor,它使用tokio的delayqueue内部进行过期通知。
可以指定tokio的delayqueue和actor之间底层通道的大小。hashmap的默认容量也可以配置。
let store = HashMapActor::with_capacity(10_000).start();
// OR
let store = HashMapActor::with_channel_size(16, 16).start();
// OR
let store = HashMapActor::with_capacity_and_channel_size(10_000, 16, 16).start();
依赖项
~15–29MB
~477K SLoC