Currently, subscriber service has a global context. We would need a local context per topic which could be used to terminate go routines working on each topic subscriber.
|
go func(subs *pubsub.Subscription) { |
|
for { |
|
select { |
|
case <-subService.ctx.Done(): |
|
close(msg) |
|
return |
|
default: |
|
} |
|
|
|
m, err := subs.Next(subService.ctx) |
|
if err != nil { |
|
continue |
|
} |
|
|
|
msg <- m |
|
} |
|
|
|
}(sub) |
Currently, subscriber service has a global context. We would need a local context per topic which could be used to terminate go routines working on each topic subscriber.
go-mesh/service/subscriber/api.go
Lines 48 to 65 in cd97627