Skip to content

Commit 6746f68

Browse files
committed
Comment on type for argument for plugin system hook functions
1 parent a6e0d57 commit 6746f68

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/src/en/examples/plugins.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def cache_remove_hook(data: CustomizedCacheData, obj_id: int | str) ->: ...
2727
def cache_free_hook(data: CustomizedCacheData) ->: ...
2828
```
2929

30+
- **Note:** `CustomizedCacheData` is not a type provided by the library. It simply represents what ever object the user decides to return from `cache_init_hook` and pass to the other hook functions as `data`.
31+
3032
## PluginAdmissioner
3133

3234
We enable users to define their own admission policies via libCacheSim's plugin system, which can be used in conjunction with existing cache implementations (e.g., `LRU`, `S3FIFO`).
@@ -51,3 +53,5 @@ def admissioner_update_hook(data: CustomizedAdmissionerData, req: Request, cache
5153
def admissioner_clone_hook(data: CustomizedAdmissionerData) -> AdmissionerBase: ...
5254
def admissioner_free_hook(data: CustomizedAdmissionerData) -> None: ...
5355
```
56+
57+
- **Note:** `CustomizedAdmissionerData` is not a type provided by the library. It simply represents what ever object the user decides to return from `admissioner_init_hook` and pass to the other hook functions as `data`.

0 commit comments

Comments
 (0)