Files
mtusi2026lab5/internal/processing/barrier.go
T

19 lines
511 B
Go

package processing
import (
"context"
"fmt"
"path/filepath"
"messenger/internal/pipeline"
"messenger/internal/platform/faultbarrier"
)
// Only the explicit fault experiment enables these one-shot barriers.
func FileBarrier(dir string) func(context.Context, pipeline.Job, string) error {
return func(ctx context.Context, j pipeline.Job, phase string) error {
base := filepath.Join(dir, fmt.Sprintf("%s-v%d-%s", j.AttachmentID, j.PipelineVersion, phase))
return faultbarrier.Wait(ctx, base, "")
}
}