Bump reva deps (#8412)
* bump dependencies Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * bump reva and add config options Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> --------- Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
+3
-3
@@ -5,8 +5,8 @@ import (
|
||||
)
|
||||
|
||||
type Pool struct {
|
||||
sync.RWMutex
|
||||
pool map[string]*Socket
|
||||
sync.RWMutex
|
||||
}
|
||||
|
||||
func (p *Pool) Get(id string) (*Socket, bool) {
|
||||
@@ -44,7 +44,7 @@ func (p *Pool) Release(s *Socket) {
|
||||
delete(p.pool, s.id)
|
||||
}
|
||||
|
||||
// Close the pool and delete all the sockets
|
||||
// Close the pool and delete all the sockets.
|
||||
func (p *Pool) Close() {
|
||||
p.Lock()
|
||||
defer p.Unlock()
|
||||
@@ -54,7 +54,7 @@ func (p *Pool) Close() {
|
||||
}
|
||||
}
|
||||
|
||||
// NewPool returns a new socket pool
|
||||
// NewPool returns a new socket pool.
|
||||
func NewPool() *Pool {
|
||||
return &Pool{
|
||||
pool: make(map[string]*Socket),
|
||||
|
||||
+9
-9
@@ -7,19 +7,19 @@ import (
|
||||
"go-micro.dev/v4/transport"
|
||||
)
|
||||
|
||||
// Socket is our pseudo socket for transport.Socket
|
||||
// Socket is our pseudo socket for transport.Socket.
|
||||
type Socket struct {
|
||||
id string
|
||||
// closed
|
||||
closed chan bool
|
||||
// remote addr
|
||||
remote string
|
||||
// local addr
|
||||
local string
|
||||
// send chan
|
||||
send chan *transport.Message
|
||||
// recv chan
|
||||
recv chan *transport.Message
|
||||
id string
|
||||
// remote addr
|
||||
remote string
|
||||
// local addr
|
||||
local string
|
||||
}
|
||||
|
||||
func (s *Socket) SetLocal(l string) {
|
||||
@@ -30,7 +30,7 @@ func (s *Socket) SetRemote(r string) {
|
||||
s.remote = r
|
||||
}
|
||||
|
||||
// Accept passes a message to the socket which will be processed by the call to Recv
|
||||
// Accept passes a message to the socket which will be processed by the call to Recv.
|
||||
func (s *Socket) Accept(m *transport.Message) error {
|
||||
select {
|
||||
case s.recv <- m:
|
||||
@@ -40,7 +40,7 @@ func (s *Socket) Accept(m *transport.Message) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Process takes the next message off the send queue created by a call to Send
|
||||
// Process takes the next message off the send queue created by a call to Send.
|
||||
func (s *Socket) Process(m *transport.Message) error {
|
||||
select {
|
||||
case msg := <-s.send:
|
||||
@@ -91,7 +91,7 @@ func (s *Socket) Recv(m *transport.Message) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Close closes the socket
|
||||
// Close closes the socket.
|
||||
func (s *Socket) Close() error {
|
||||
select {
|
||||
case <-s.closed:
|
||||
|
||||
Reference in New Issue
Block a user