Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
abstract Conn Stat interface for threading
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Feb 4, 2021
1 parent c2a150e commit 43260f4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions network/conn.go
Expand Up @@ -19,6 +19,7 @@ type Conn interface {

ConnSecurity
ConnMultiaddrs
ConnStat

// ID returns an identifier that uniquely identifies this Conn within this
// host, during this run. Connection IDs may repeat across restarts.
Expand All @@ -29,9 +30,6 @@ type Conn interface {

// GetStreams returns all open streams over this conn.
GetStreams() []Stream

// Stat stores metadata pertaining to this conn.
Stat() Stat
}

// ConnSecurity is the interface that one can mix into a connection interface to
Expand Down Expand Up @@ -61,3 +59,8 @@ type ConnMultiaddrs interface {
// with this connection
RemoteMultiaddr() ma.Multiaddr
}

type ConnStat interface {
// Stat stores metadata pertaining to this conn.
Stat() Stat
}

0 comments on commit 43260f4

Please sign in to comment.