func NewSequentialTaskProcessor(
	coroutineSize int,
	taskQueueHashFn collection.HashFunc,
	taskQueueFactory SequentialTaskQueueFactory,
	metricsClient metrics.Client,
	logger log.Logger,
) Processor {
	return &sequentialTaskProcessorImpl{
		status:           common.DaemonStatusInitialized,
		shutdownChan:     make(chan struct{}),
		coroutineSize:    coroutineSize,
		taskqueues:       collection.NewShardedConcurrentTxMap(1024, taskQueueHashFn),
		taskQueueFactory: taskQueueFactory,
		taskqueueChan:    make(chan SequentialTaskQueue, coroutineSize),
		metricsScope:     metricsClient.Scope(metrics.SequentialTaskProcessingScope),
		logger:           logger,
	}
}
NewSequentialTaskProcessor create a new sequential tasks processor
package task
import (
	"sync"
	"sync/atomic"
	"time"
	"go.temporal.io/server/common"
	"go.temporal.io/server/common/collection"
	"go.temporal.io/server/common/log"
	"go.temporal.io/server/common/log/tag"
	"go.temporal.io/server/common/metrics"
)
type (
	sequentialTaskProcessorImpl struct {
		status       int32
		shutdownChan chan struct{}
		waitGroup    sync.WaitGroup
		coroutineSize    int
		taskqueues       collection.ConcurrentTxMap
		taskQueueFactory SequentialTaskQueueFactory
		taskqueueChan    chan SequentialTaskQueue
		metricsScope metrics.Scope
		logger       log.Logger
	}
)