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

ISSUE-18642 - Implement graceful shutdown in all Argo CD components #6

Open
daengdaengLee opened this issue Aug 3, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@daengdaengLee
Copy link
Member

daengdaengLee commented Aug 3, 2024

ISSUE-18642 - Implement graceful shutdown in all Argo CD components

이슈 내용

진행 사항

@daengdaengLee daengdaengLee added the bug Something isn't working label Aug 3, 2024
@daengdaengLee
Copy link
Member Author

daengdaengLee commented Aug 6, 2024

Graceful Shutdown in Go

고루틴 (goroutine)

  • 참고 : https://go.dev/tour/concurrency/1
  • Golang 에서 제공하는 경량 스레드 (대충)
  • go 키워드를 함수 호출 앞에 붙여서 사용
    • 이름 있는 함수의 경우 : go doSomething()
    • 이름 없는 함수의 경우 : go func() {}()
  • go 키워드 뒤에 실행한 함수는 다른 스레드에서 실행, 기존 코드 흐름과 동시에 실행됨 (대충)
    func main() {
        // ...
        go doSomething()
        // ...
        // doSomething 함수 실행 안 기다리고 바로 이어서 아래 코드 실행
    }

채널 (chan)

  • 참고 : https://go.dev/tour/concurrency/2
  • 고루틴 사이에 데이터를 주고받을 수 있는 통로
  • 두 컴퓨터를 연결한 소켓 연결같은 것 (많이 대충)
  • 채널의 타입은 chan <채널로 주고받을 데이터 타입> 형태
    • chan intint 를 주고받을 수 있는 채널
  • 채널 생성할 때 : make 내장 함수 사용
    • make(chan int) 처럼 함수 인자로 만들고 싶은 채널 타입 지정
  • 채널에 데이터를 넣을 때 : myCh <- 1
  • 채널에서 데이터를 꺼낼 때 : <-myCh
    • 채널에서 데이터 꺼내서 변수에 바인딩 예시 : value := <-myCh
    • 채널에서 데이터 꺼내기만 하는 것도 가능

select 문법

@todo

@leehosu
Copy link

leehosu commented Aug 10, 2024

건호님 코드 참고해서 controller 작업해보고 싶습니다요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants