[signal] Use signal dispatcher (#2373)

This commit is contained in:
pascal-fischer
2024-08-30 15:44:07 +02:00
committed by GitHub
parent 5ac6f56594
commit 92a0092ad5
4 changed files with 82 additions and 75 deletions

View File

@@ -18,16 +18,20 @@ type Peer struct {
StreamID int64
//a gRpc connection stream to the Peer
// a gRpc connection stream to the Peer
Stream proto.SignalExchange_ConnectStreamServer
// registration time
RegisteredAt time.Time
}
// NewPeer creates a new instance of a connected Peer
func NewPeer(id string, stream proto.SignalExchange_ConnectStreamServer) *Peer {
return &Peer{
Id: id,
Stream: stream,
StreamID: time.Now().UnixNano(),
Id: id,
Stream: stream,
StreamID: time.Now().UnixNano(),
RegisteredAt: time.Now(),
}
}