Skip to content
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

Counter thread safe with mutex from http/proxy/limit.go #13

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

canerarif
Copy link

No description provided.

@gunerhuseyin
Copy link
Member

gunerhuseyin commented Oct 12, 2021

Eline saglik @canerarif,

Burada mutex ve mapi bir custom structa alip, increment ve setDefault functionlarini bu structin receiveri olarak duzenleyebilir misin? Orn:

type Counter struct{
    c map[string]*Limit{}
    m sync.Mutex
}

func (c *Counter) Increment(){
    //TODO: implement me!
}

func (c *Counter) Reset(){
    //TODO: implement me!
}

@gunerhuseyin gunerhuseyin added the enhancement New feature or request label Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants