package logstash

import (
	"github.com/mhaya"
	mhayaCron "github.com/mhaya/components/cron"
	mhayaMongo "github.com/mhaya/components/mongo"
	"github.com/mhaya/game/game_cluster/internal/data"
	"github.com/mhaya/game/game_cluster/internal/mdb"
	"github.com/mhaya/game/game_cluster/nodes/center/module/ops"
	"github.com/mhaya/game/game_cluster/nodes/logstash/module/handlelog"
)

func Run(profileFilePath, nodeId string) {
	app := mhaya.Configure(
		profileFilePath,
		nodeId,
		false,
		mhaya.Cluster,
	)

	app.Register(mhayaCron.New())
	app.Register(data.New())
	// 注册db组件
	app.Register(mhayaMongo.NewComponent())

	app.AddActors(
		&handlelog.HandleLogObject{},
		&ops.ActorOps{},
		&mdb.ActorDB{},
	)

	app.Startup()
}
