Skip to content

go routine per topic should be terminated if that topic is unsubscribed #28

Description

@upperwal

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions