Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Allocation optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
Baliedge committed Sep 29, 2023
1 parent 83d3f0f commit 3b8e882
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type Worker struct {
name string
conf *Config
cache Cache
getRateLimitRequest chan *request
getRateLimitRequest chan request
storeRequest chan workerStoreRequest
loadRequest chan workerLoadRequest
addCacheItemRequest chan workerAddCacheItemRequest
Expand Down Expand Up @@ -163,7 +163,7 @@ func (p *WorkerPool) newWorker() *Worker {
worker := &Worker{
conf: p.conf,
cache: p.conf.CacheFactory(p.workerCacheSize),
getRateLimitRequest: make(chan *request),
getRateLimitRequest: make(chan request),
storeRequest: make(chan workerStoreRequest),
loadRequest: make(chan workerLoadRequest),
addCacheItemRequest: make(chan workerAddCacheItemRequest),
Expand Down Expand Up @@ -276,7 +276,7 @@ func (p *WorkerPool) dispatch(worker *Worker) {
func (p *WorkerPool) GetRateLimit(ctx context.Context, rlRequest *RateLimitReq) (retval *RateLimitResp, reterr error) {
// Delegate request to assigned channel based on request key.
worker := p.getWorker(rlRequest.HashKey())
handlerRequest := &request{
handlerRequest := request{
ctx: ctx,
resp: make(chan *response, 1),
request: rlRequest,
Expand Down

0 comments on commit 3b8e882

Please sign in to comment.