Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drpcconn: Expose termination signal #17

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions drpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ type Conn interface {
// Close closes the connection.
Close() error

// Closed returns true if the connection is definitely closed.
Closed() bool
// Closed returns a channel that is closed if the connection is definitely closed.
Closed() <-chan struct{}

// Transport returns the transport the connection is using.
Transport() Transport
Expand Down
4 changes: 2 additions & 2 deletions drpcconn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Close closes the connection.
#### func (*Conn) Closed

```go
func (c *Conn) Closed() bool
func (c *Conn) Closed() <-chan struct{}
```
Closed returns true if the connection is already closed.
Closed returns a channel that is closed once the connection is closed.

#### func (*Conn) Invoke

Expand Down
4 changes: 2 additions & 2 deletions drpcconn/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func (c *Conn) Transport() drpc.Transport {
return c.tr
}

// Closed returns true if the connection is already closed.
func (c *Conn) Closed() bool {
// Closed returns a channel that is closed once the connection is closed.
func (c *Conn) Closed() <-chan struct{} {
return c.man.Closed()
}

Expand Down
4 changes: 2 additions & 2 deletions drpcmanager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ Close closes the transport the manager is using.
#### func (*Manager) Closed

```go
func (m *Manager) Closed() bool
func (m *Manager) Closed() <-chan struct{}
```
Closed returns if the manager has been closed.
Closed returns a channel that is closed once the manager is closed

#### func (*Manager) NewClientStream

Expand Down
6 changes: 3 additions & 3 deletions drpcmanager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ func (m *Manager) waitForPreviousStream(ctx context.Context) (err error) {
// exported interface
//

// Closed returns if the manager has been closed.
func (m *Manager) Closed() bool {
return m.term.IsSet()
// Closed returns a channel that is closed once the manager is closed.
func (m *Manager) Closed() <-chan struct{} {
return m.term.Signal()
}

// Close closes the transport the manager is using.
Expand Down