Skip to content

Commit 41a6f32

Browse files
committed
removed more queues
1 parent 9e0a1c2 commit 41a6f32

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

engine/dispatcher/dispatcher.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ type dis struct {
2626
mgr et.SessionManager
2727
done chan struct{}
2828
dchan chan *et.Event
29-
pchan chan *et.Event
3029
cchan chan *et.EventDataElement
3130
}
3231

@@ -41,7 +40,6 @@ func NewDispatcher(l *slog.Logger, r et.Registry, mgr et.SessionManager) et.Disp
4140
mgr: mgr,
4241
done: make(chan struct{}),
4342
dchan: make(chan *et.Event, MinPipelineQueueSize),
44-
pchan: make(chan *et.Event, MinPipelineQueueSize),
4543
cchan: make(chan *et.EventDataElement, MinPipelineQueueSize),
4644
}
4745

@@ -89,10 +87,6 @@ loop:
8987
}
9088
case e := <-d.cchan:
9189
d.completedCallback(e)
92-
case e := <-d.pchan:
93-
if err := d.appendToPipeline(e); err != nil {
94-
d.logger.Error(fmt.Sprintf("Failed to append to a data pipeline: %s", err.Error()))
95-
}
9690
}
9791
}
9892
}
@@ -120,11 +114,14 @@ func (d *dis) fillPipelineQueues() {
120114
for _, atype := range ptypes {
121115
if entities, err := s.Queue().Next(atype, numRequested); err == nil && len(entities) > 0 {
122116
for _, entity := range entities {
123-
d.pchan <- &et.Event{
117+
e := &et.Event{
124118
Name: fmt.Sprintf("%s - %s", string(atype), entity.Asset.Key()),
125119
Entity: entity,
126120
Session: s,
127121
}
122+
if err := d.appendToPipeline(e); err != nil {
123+
d.logger.Error(fmt.Sprintf("Failed to append to a data pipeline: %s", err.Error()))
124+
}
128125
}
129126
}
130127
}
@@ -173,6 +170,7 @@ func (d *dis) safeDispatch(e *et.Event) error {
173170

174171
if qlen := ap.Queue.Len(); e.Meta != nil || qlen < MinPipelineQueueSize {
175172
if err := d.appendToPipeline(e); err != nil {
173+
d.logger.Error(fmt.Sprintf("Failed to append to a data pipeline: %s", err.Error()))
176174
return err
177175
}
178176
}

0 commit comments

Comments
 (0)