Close the Go Cloud publisher.
(ctx context.Context)
| 67 | |
| 68 | // Close the Go Cloud publisher. |
| 69 | func (ps *PubSub) Close(ctx context.Context) error { |
| 70 | if err := ps.topic.Shutdown(ps.ctx); err != nil { |
| 71 | return err |
| 72 | } |
| 73 | ps.cancel() |
| 74 | select { |
| 75 | case <-ctx.Done(): |
| 76 | return ctx.Err() |
| 77 | case <-ps.ctx.Done(): |
| 78 | return ps.ctx.Err() |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | func (ps *PubSub) subscribeTask(ctx context.Context) error { |
| 83 | if ps.subURL == "" { |