package serverimp

import (
	"context"
	"sync"

	"github.com/tech/sendico/edge/callbacks/internal/config"
	"github.com/tech/sendico/edge/callbacks/internal/delivery"
	"github.com/tech/sendico/edge/callbacks/internal/ingest"
	"github.com/tech/sendico/edge/callbacks/internal/ops"
	"github.com/tech/sendico/pkg/db"
	mb "github.com/tech/sendico/pkg/messaging/broker"
	"github.com/tech/sendico/pkg/mlogger"
)

type Imp struct {
	logger mlogger.Logger
	file   string
	debug  bool

	config *config.Config

	mongoConn *db.MongoConnection
	broker    mb.Broker

	ingest   ingest.Service
	delivery delivery.Service

	opServer ops.HTTPServer

	runCancel context.CancelFunc
	shutdown  sync.Once
	stopOnce  sync.Once
	doneOnce  sync.Once
	stopCh    chan struct{}
	doneCh    chan struct{}
}
