-
-
Notifications
You must be signed in to change notification settings - Fork 14
Feat: Object Pool Manager #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d21fa4d
feat: implement PoolManager and enhance object pool options
chinfuyang d260d62
feat: add recycling strategy contracts and implement TimeRecycleStrategy
chinfuyang b9d6d95
chore: remove ConstantFrequency and LowFrequencyInterface classes
chinfuyang bc2af6e
style: lint
chinfuyang ea41e44
style: lint
chinfuyang 1cd0570
feat: rename RecycleStrategy and TimeRecycleStrategy interfaces, impl…
chinfuyang 8ce08c5
feat: add detailed PHPDoc comments
chinfuyang 2453d49
chore: remove PoolFactory class and update tests to use PoolManager
chinfuyang 3dad015
Merge branch 'main' into feature/pool-manager
albertcht feed82e
refactor: refactor object pool
albertcht 659b290
chore: add carbon dependency in composer.json
albertcht 800e02e
improve: make pool property in pool proxy as contract
albertcht 890f7a1
chore: fix wording
albertcht 369f23a
improve: resolve strategy with singleton in ObjectPool
albertcht 62a4c69
refactor: use pool factory contract in PoolProxy
albertcht df2aabd
fix: fix dependency of pool manager in ObjectRecycler
albertcht fa118cf
Merge branch 'main' of github.com:hypervel/components
albertcht 37486f0
Merge branch 'main' into feature/pool-manager
albertcht File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Hypervel\ObjectPool\Contracts; | ||
|
|
||
| use Hypervel\ObjectPool\ObjectPool; | ||
|
|
||
| interface RecycleStrategy | ||
| { | ||
| /** | ||
| * Determines if the pool should recycle objects at this time. | ||
| */ | ||
| public function shouldRecycle(ObjectPool $pool): bool; | ||
|
|
||
| /** | ||
| * Performs the recycling operation on the pool. | ||
| */ | ||
| public function recycle(ObjectPool $pool): void; | ||
|
|
||
| /** | ||
| * Returns the timestamp of the last recycling operation. | ||
| */ | ||
| public function getLastRecycledTimestamp(): int; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Hypervel\ObjectPool\Contracts; | ||
|
|
||
| interface TimeRecycleStrategy extends RecycleStrategy | ||
| { | ||
| /** | ||
| * Gets the time interval between recycling operations. | ||
| */ | ||
| public function getRecycleTime(): float; | ||
albertcht marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.