// Run will start the projector
Run will start the projector
// Run will start the projector
func (p *Projector) Run(ctx context.Context) error {
	var wg sync.WaitGroup
	for _, projection := range p.projections {
		wg.Add(1)
		go func(projection Projection) {
			defer wg.Done()
			for {
				sub, err := p.streamer.SubscribeAll(ctx)
				if err != nil {
					p.logErr(err)
					return
				}
				defer sub.Close()
				if err := p.run(ctx, sub, projection); err != nil {
					continue
				}
				return
			}
		}(projection)
	}
	wg.Wait()
	return nil
}
func ( p * Projector ) Run ( ctx context . Context ) error { var wg sync . WaitGroup for _ , projection := range p . projections { wg . Add ( 1 ) go func ( projection Projection ) { defer wg . Done ( ) for { sub , err := p . streamer . SubscribeAll ( ctx ) if err != nil { p . logErr ( err ) return } defer sub . Close ( ) if err := p . run ( ctx , sub , projection ) ; err != nil { continue } return } } ( projection ) } wg . Wait ( ) return nil }
Run will start the projector
Run will start the projector
// TODO retry with backoff