Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/05-design/02-admission-picker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Admission Picker

## What is the admission picker?

The admission picker is used to determine whether the entry should be inserted
into the disk cache. It is a component of the hybrid cache.

You can use it when you create a hybrid cache. For example:

```rust
let hybrid: HybridCache<u64, String> = HybridCacheBuilder::new()
.memory(64 * 1024 * 1024)
.storage(Engine::Large)
.with_admission_picker(Arc::new(RateLimitPicker::new(100 * 1024 * 1024)))
.build()
.await?;
```

## Admission types

### RateLimitPicker
2 changes: 1 addition & 1 deletion docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const config: Config = {
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/foyer-rs/website/tree/main/',
includeCurrentVersion: false,
includeCurrentVersion: true,
},
blog: {
showReadingTime: true,
Expand Down
21 changes: 21 additions & 0 deletions versioned_docs/version-0.12/05-design/02-admission-picker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Admission Picker

## What is the admission picker?

The admission picker is used to determine whether the entry should be inserted
into the disk cache. It is a component of the hybrid cache.

You can use it when you create a hybrid cache. For example:

```rust
let hybrid: HybridCache<u64, String> = HybridCacheBuilder::new()
.memory(64 * 1024 * 1024)
.storage(Engine::Large)
.with_admission_picker(Arc::new(RateLimitPicker::new(100 * 1024 * 1024)))
.build()
.await?;
```

## Admission types

### RateLimitPicker