feat(worker): create pipeline skeleton
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package worker
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"high-loud-apps-labs/internal/domain"
|
||||
)
|
||||
|
||||
type Pipeline struct {
|
||||
jobs domain.AttachmentJobRepository
|
||||
store domain.ObjectStorage
|
||||
variants domain.AttachmentVariantRepository
|
||||
lease time.Duration
|
||||
}
|
||||
|
||||
func NewPipeline(jobs domain.AttachmentJobRepository, store domain.ObjectStorage, variants domain.AttachmentVariantRepository) *Pipeline {
|
||||
return &Pipeline{
|
||||
jobs: jobs,
|
||||
store: store,
|
||||
variants: variants,
|
||||
lease: 5 * time.Minute,
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Pipeline) Process(ctx context.Context, attachmentID string) error {
|
||||
log.Printf("worker: получена задача на обработку %s (заглушка)", attachmentID)
|
||||
// TODO
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user