Skip to content

Commit

Permalink
pubsub: improve Client.Close doc
Browse files Browse the repository at this point in the history
Clarify that Close releases goroutines and memory, and try
to explain better when you don't have to call it.

Updates #711.

Change-Id: I7f2fca57da4f5bbcd0d3d5a327d365457973c113
Reviewed-on: https://code-review.googlesource.com/20250
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Michael Darakananda <pongad@google.com>
  • Loading branch information
jba committed Dec 4, 2017
1 parent 1c4a3ef commit 442eb1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pubsub/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ func NewClient(ctx context.Context, projectID string, opts ...option.ClientOptio
return c, nil
}

// Close closes any resources held by the client.
// Close releases any resources held by the client,
// such as memory and goroutines.
//
// Close need not be called at program exit.
// If the client is available for the lifetime of the program, then Close need not be
// called at exit.
func (c *Client) Close() error {
return c.s.close()
}
Expand Down

0 comments on commit 442eb1f

Please sign in to comment.