https://github.com/venndev/vcache
- Virion helps minimize data query processing or anti-spam data repeating multiple times at a time. It also helps query data quickly! for PocketMine-PMMP
https://github.com/venndev/vcache
Last synced: 11 months ago
JSON representation
- Virion helps minimize data query processing or anti-spam data repeating multiple times at a time. It also helps query data quickly! for PocketMine-PMMP
- Host: GitHub
- URL: https://github.com/venndev/vcache
- Owner: VennDev
- License: apache-2.0
- Created: 2024-08-09T19:35:16.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-10T06:47:57.000Z (almost 2 years ago)
- Last Synced: 2025-06-14T15:03:49.083Z (12 months ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VCache
- Virion helps minimize data query processing or anti-spam data repeating multiple times at a time. It also helps query data quickly! for PocketMine-PMMP
# Virion Required
- [LibVapmPMMP](https://github.com/VennDev/LibVapmPMMP)
# Example
```php
$this->cache = new VCache($this);
$this->getScheduler()->scheduleRepeatingTask(new ClosureTask(function (): void {
// This is fast query processing!
$this->cache->doCache("This is Key A", function (): string {
sleep(3); // Let's say something processed takes 3s to complete!
return "result_data"; // This is the processing of the query or something that you want to return when the processing is done here
}, function (string $data): void {
$this->getServer()->broadcastMessage($data);
},
true,
10);
// This is anti-duplicate handling in addition to fast querying!
$this->cache->doNoSpamCache(["This is Key B", "ASDASDAS", "ASDASD], function (): string {
sleep(3); // Let's say something processed takes 3s to complete!
return "result_data"; // This is the processing of the query or something that you want to return when the processing is done here
}, function (string $data): void {
$this->getServer()->broadcastMessage($data);
},
true,
10);
}), 20);
```