1 Star 0 Fork 65

Leron Gubler / gitbitex-spot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.go 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
greensheng 提交于 2019-10-17 20:24 . fix bug:too many open files
// Copyright 2019 GitBitEx.com
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
"github.com/gitbitex/gitbitex-spot/conf"
"github.com/gitbitex/gitbitex-spot/matching"
"github.com/gitbitex/gitbitex-spot/models"
"github.com/gitbitex/gitbitex-spot/pushing"
"github.com/gitbitex/gitbitex-spot/rest"
"github.com/gitbitex/gitbitex-spot/service"
"github.com/gitbitex/gitbitex-spot/worker"
"github.com/prometheus/common/log"
"net/http"
_ "net/http/pprof"
)
func main() {
gbeConfig := conf.GetConfig()
go func() {
log.Info(http.ListenAndServe("localhost:6060", nil))
}()
go models.NewBinLogStream().Start()
matching.StartEngine()
pushing.StartServer()
worker.NewFillExecutor().Start()
worker.NewBillExecutor().Start()
products, err := service.GetProducts()
if err != nil {
panic(err)
}
for _, product := range products {
worker.NewTickMaker(product.Id, matching.NewKafkaLogReader("tickMaker", product.Id, gbeConfig.Kafka.Brokers)).Start()
worker.NewFillMaker(matching.NewKafkaLogReader("fillMaker", product.Id, gbeConfig.Kafka.Brokers)).Start()
worker.NewTradeMaker(matching.NewKafkaLogReader("tradeMaker", product.Id, gbeConfig.Kafka.Brokers)).Start()
}
rest.StartServer()
select {}
}
Go
1
https://gitee.com/nazha/gitbitex-spot.git
git@gitee.com:nazha/gitbitex-spot.git
nazha
gitbitex-spot
gitbitex-spot
master

搜索帮助