-
Notifications
You must be signed in to change notification settings - Fork 21
Feat: pool adapter #101
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
base: main
Are you sure you want to change the base?
Feat: pool adapter #101
Conversation
| public function delegate(string $method, array $args): mixed | ||
| { | ||
| return $this->pool->use(function (Redis $redis) use ($method, $args) { | ||
| $adapter = new RedisAdapter($this->key, $this->limit, $this->seconds, $redis); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we instantiate the adapter in the pool init function instead? This way, we instantiate a new adapter for every call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not see a clear path to implement it that way in the init function creating a pool of timeLimit :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not gonna work. The adapters set the $count on the instance, if you create a new instance for every call, it's always gonna be 0.
We can't use the proxy approach here, you need to refactor the adapters to take a pool itself instead of wrapping them.
Co-authored-by: Jake Barnby <[email protected]>
No description provided.