고랭 채널 비동기 (1) 썸네일형 리스트형 고(golang) 비동기 큐 구현 웹에서 고용량 파일을 다룰때 비동기 시스템은 거의 필수적입니다. 고 언어는 Channel 이라는 기능으로 이를 쉽게 구축할 수 있습니다. 사용한 프레임워크는 Gin 입니다. go get github.com/gin-gonic/gin@master쉘에서 Gin 프레임워크를 가져옵니다. // main.go r := gin.New() srv := &http.Server{ Handler: r, Addr: fmt.Sprintf(":%d", PORT), ReadTimeout: 30 * time.Second, WriteTimeout: 30 * time.Second, } r.GET("/file-handler",func(c *gin.Context) { queue.AsyncQueue.Enqueue(queue.FileUploa.. 이전 1 다음