summaryrefslogtreecommitdiff
path: root/internal/mapr/aggregateset.go
diff options
context:
space:
mode:
authorPaul Bütow <pbuetow@mimecast.com>2020-01-26 11:26:53 +0000
committerPaul Bütow <pbuetow@mimecast.com>2020-02-07 13:31:15 +0000
commit0945da8dfefcbb723eecea0e5f4eafff63398253 (patch)
treef06dab4d2bf21d25d176b23d5baeca588d27f5d7 /internal/mapr/aggregateset.go
parent2a8e5de265a0e0a31a5834909d6879f5c9941467 (diff)
Introduce drun command, refactor code to use context package
Diffstat (limited to 'internal/mapr/aggregateset.go')
-rw-r--r--internal/mapr/aggregateset.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/mapr/aggregateset.go b/internal/mapr/aggregateset.go
index 2096c3c..7fb4c17 100644
--- a/internal/mapr/aggregateset.go
+++ b/internal/mapr/aggregateset.go
@@ -1,6 +1,7 @@
package mapr
import (
+ "context"
"fmt"
"strconv"
"strings"
@@ -64,7 +65,7 @@ func (s *AggregateSet) Merge(query *Query, set *AggregateSet) error {
}
// Serialize the aggregate set so it can be sent over the wire.
-func (s *AggregateSet) Serialize(groupKey string, ch chan<- string, stop chan struct{}) {
+func (s *AggregateSet) Serialize(ctx context.Context, groupKey string, ch chan<- string) {
//logger.Trace("Serialising mapr.AggregateSet", s)
var sb strings.Builder
@@ -87,7 +88,7 @@ func (s *AggregateSet) Serialize(groupKey string, ch chan<- string, stop chan st
select {
case ch <- sb.String():
- case <-stop:
+ case <-ctx.Done():
}
}