Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/socket/subscriber_request_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
dc *DuplexConnection
sid uint32
receiving fragmentation.HeaderAndPayload
sndCnt int32
sndCnt atomic.Int32

Check failure on line 40 in internal/socket/subscriber_request_response.go

View workflow job for this annotation

GitHub Actions / runner / golangci-lint

[golangci] reported by reviewdog 🐶 undefined: atomic.Int32 (typecheck) Raw Output: internal/socket/subscriber_request_response.go:40:19: undefined: atomic.Int32 (typecheck) sndCnt atomic.Int32 ^
}

func borrowRequestResponseSubscriber(dc *DuplexConnection, sid uint32, receiving fragmentation.HeaderAndPayload) rx.Subscriber {
Expand All @@ -55,13 +55,13 @@
}
actual.dc = nil
actual.receiving = nil
actual.sndCnt = 0
actual.sndCnt.Store(0)
globalRequestResponseSubscriberPool.put(actual)
}

func (r *requestResponseSubscriber) OnNext(next payload.Payload) {
r.dc.sendPayload(r.sid, next, core.FlagNext|core.FlagComplete)
atomic.AddInt32(&r.sndCnt, 1)
r.sndCnt.Add(1)
}

func (r *requestResponseSubscriber) OnError(err error) {
Expand All @@ -73,7 +73,7 @@
}

func (r *requestResponseSubscriber) OnComplete() {
if atomic.AddInt32(&r.sndCnt, 1) == 1 {
if r.sndCnt.Add(1) == 1 {
r.dc.sendPayload(r.sid, payload.Empty(), core.FlagComplete)
}
r.dc.unregister(r.sid)
Expand Down
Loading