func NewBridgeWorker(config config.WorkerConfig, storage storage.PersistentStorage, producer producer.Producer, statsClient client.Client) (*BridgeWorker, error) {
	return &BridgeWorker{config: config, storage: storage, producer: producer, statsClient: statsClient}, nil
}
NewBridgeWorker creates instance of BridgeWorker
package workers
import (
	"encoding/json"
	"errors"
	"sync"
	"time"
	"github.com/hellofresh/stats-go/bucket"
	"github.com/hellofresh/stats-go/client"
	log "github.com/sirupsen/logrus"
	"github.com/hellofresh/kandalf/pkg/config"
	"github.com/hellofresh/kandalf/pkg/producer"
	"github.com/hellofresh/kandalf/pkg/storage"
)
const (
	statsWorkerSection = "worker"
)
var (
	errMarshalMessage = errors.New("failed to marshal message")
	errPutToStorage   = errors.New("failed to put message to storage")
)
type BridgeWorker struct {
	sync.Mutex
	config      config.WorkerConfig
	storage     storage.PersistentStorage
	producer    producer.Producer
	statsClient client.Client
	cache             []*producer.Message
	lastFlush         time.Time
	readStorageTicker *time.Ticker
}