github.com/whoyao/protocol@v0.0.0-20230519045905-2d8ace718ca5/rpc/typed_api.go (about)

     1  package rpc
     2  
     3  import (
     4  	"github.com/livekit/psrpc"
     5  	"github.com/whoyao/protocol/livekit"
     6  )
     7  
     8  type TypedSignalClient = SignalClient[livekit.NodeID]
     9  type TypedSignalServer = SignalServer[livekit.NodeID]
    10  
    11  func NewTypedSignalClient(nodeID livekit.NodeID, bus psrpc.MessageBus, opts ...psrpc.ClientOption) (TypedSignalClient, error) {
    12  	return NewSignalClient[livekit.NodeID](string(nodeID), bus, opts...)
    13  }
    14  
    15  func NewTypedSignalServer(nodeID livekit.NodeID, svc SignalServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (TypedSignalServer, error) {
    16  	return NewSignalServer[livekit.NodeID](string(nodeID), svc, bus, opts...)
    17  }