@@ -22,31 +22,31 @@ import (
22
22
)
23
23
24
24
type conn struct {
25
- lock sync.RWMutex
26
- streamLock sync.Mutex
27
- stream rtv1pb.Dapr_SubscribeTopicEventsAlpha1Server
28
- publishResponses3 map [ string ] map [rtpubsub. ConnectionID ] chan * rtv1pb. SubscribeTopicEventsRequestProcessedAlpha1
29
- closeCh chan struct {}
30
- closed atomic. Bool
31
- connectionID rtpubsub. ConnectionID
25
+ lock sync.RWMutex
26
+ streamLock sync.Mutex
27
+ stream rtv1pb.Dapr_SubscribeTopicEventsAlpha1Server
28
+ closeCh chan struct {}
29
+ closed atomic. Bool
30
+ connectionID rtpubsub. ConnectionID
31
+ publishResponses PublishResponses
32
32
}
33
33
34
34
func (c * conn ) registerPublishResponse (id string ) (chan * rtv1pb.SubscribeTopicEventsRequestProcessedAlpha1 , func ()) {
35
35
ch := make (chan * rtv1pb.SubscribeTopicEventsRequestProcessedAlpha1 , 1 )
36
36
c .lock .Lock ()
37
37
38
- if c .publishResponses3 [id ] == nil {
39
- c .publishResponses3 [id ] = make (map [rtpubsub. ConnectionID ] chan * rtv1pb. SubscribeTopicEventsRequestProcessedAlpha1 )
38
+ if c .publishResponses [id ] == nil {
39
+ c .publishResponses [id ] = make (ConnectionChannel )
40
40
}
41
- c.publishResponses3 [id ][c.connectionID ] = ch
41
+ c.publishResponses [id ][c.connectionID ] = ch
42
42
43
43
c .lock .Unlock ()
44
44
return ch , func () {
45
45
c .lock .Lock ()
46
46
47
- delete (c .publishResponses3 [id ], c .connectionID )
48
- if len (c .publishResponses3 [id ]) == 0 {
49
- delete (c .publishResponses3 , id )
47
+ delete (c .publishResponses [id ], c .connectionID )
48
+ if len (c .publishResponses [id ]) == 0 {
49
+ delete (c .publishResponses , id )
50
50
}
51
51
52
52
c .lock .Unlock ()
@@ -61,7 +61,7 @@ func (c *conn) registerPublishResponse(id string) (chan *rtv1pb.SubscribeTopicEv
61
61
62
62
func (c * conn ) notifyPublishResponse (resp * rtv1pb.SubscribeTopicEventsRequestProcessedAlpha1 ) {
63
63
c .lock .RLock ()
64
- ch , ok := c .publishResponses3 [resp .GetId ()][c .connectionID ]
64
+ ch , ok := c .publishResponses [resp .GetId ()][c .connectionID ]
65
65
c .lock .RUnlock ()
66
66
67
67
if ! ok {
0 commit comments