func (p *Pipeline) SetDrainTimeout(timeout time.Duration) {
	p.DrainTimeout = timeout
}
SetDrainTimeout sets DrainTimeout
package pipeline
import (
	"context"
	"fmt"
	"reflect"
	"strings"
	"time"
	"unicode"
	"github.com/fatih/color"
)
const DefaultDrainTimeout = time.Second * 5
const DefaultBuffer = 1000
type Pipeline struct {
	Name             string   `json:"name"`
	Stages           []*Stage `json:"stages"`
	DrainTimeout     time.Duration
	expectedDuration time.Duration
	duration         time.Duration
	outsubscribed    bool
	outbufferlen     int
	tick             time.Duration
	cancelDrain      context.CancelFunc
	cancelProgress   context.CancelFunc
}
func New(name string, outBufferLen int) *Pipeline {
	return newPipeline(name, outBufferLen)
}
func NewProgress(name string, outBufferLen int, expectedDuration time.Duration) *Pipeline {
	p := newPipeline(name, outBufferLen)
	p.expectedDuration = expectedDuration
	p.tick = time.Millisecond * 250
	return p
}
func newPipeline(name string, outBufferLen int) *Pipeline {
	if outBufferLen < 0 {
		outBufferLen = 1
	}
	if buffersMap == nil {
		buffersMap = &buffers{bufferMap: make(map[string]*buffer)}
	}
	p := &Pipeline{Name: spaceMap(name)}
	p.outbufferlen = outBufferLen
	if p.DrainTimeout == 0 {
		p.DrainTimeout = DefaultDrainTimeout
	}
	buf := buffer{in: make(chan string, outBufferLen), out: []chan string{}, progress: []chan int64{}}
	buffersMap.set(p.Name, &buf)
	return p
}