mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
29 lines
413 B
Go
29 lines
413 B
Go
package apps
|
|
|
|
import (
|
|
"github.com/apex/log"
|
|
"github.com/crawlab-team/crawlab-core/grpc"
|
|
)
|
|
|
|
type Worker struct {
|
|
handler *Handler
|
|
}
|
|
|
|
func (app *Worker) Init() {
|
|
_ = initModule("grpc", grpc.InitGrpcServices)
|
|
}
|
|
|
|
func (app *Worker) Run() {
|
|
log.Info("worker has started")
|
|
}
|
|
|
|
func (app *Worker) Stop() {
|
|
log.Info("worker has stopped")
|
|
}
|
|
|
|
func NewWorker() *Worker {
|
|
return &Worker{
|
|
handler: NewHandler(),
|
|
}
|
|
}
|