重构密集计算,使用Go
-
install imagick homebrew install imagemagick --universal to build fat binaries.
-
install go, prepare go dev env.
-
install go modules(third party modules in import)
-
go build main.go config.go logger.go
-
run ./main , run test.js
- main goroutine listens to redis message
- Once a message comming, start a goroutine to process image
- In config.go MAXWORKER to control the maxium workers that process at the same time
- Current, only wirte resize action.
- If there is a scalable issue, static language should be adopted.
- php can be adopted to implement the idea.