data.go 432 B

123456789101112131415161718192021222324
  1. package main
  2. import (
  3. simplejson "github.com/go-simplejson"
  4. )
  5. var taskChan []chan *taskInfo
  6. var CHANNUM = 1024
  7. type taskInfo struct {
  8. cointype string
  9. urlpath string
  10. resp *taskHandler
  11. jshandler *simplejson.Json
  12. }
  13. func initChanHandler(processNum int) {
  14. log.Debug("ininit taskChan")
  15. taskChan = make([]chan *taskInfo, processNum)
  16. for i := 0; i < processNum; i++ {
  17. taskChan[i] = make(chan *taskInfo, CHANNUM)
  18. }
  19. }