Skip to content

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

Open
canerarif wants to merge 5 commits intoGoTurkiye:mainfrom
canerarif:main
Open

Counter thread safe with mutex from http/proxy/limit.go#13
canerarif wants to merge 5 commits intoGoTurkiye:mainfrom
canerarif:main

Conversation

@canerarif
Copy link
Copy Markdown

No description provided.

@gunerhuseyin
Copy link
Copy Markdown
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