You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Index method is not implemented in wrpcnats.paramWriter, because as part of the root subject write it may lazily perform the handshake.
The implementation should be updated in such a way that the indexed parameter writers would not be able to write until the root writer performs the handshake. The transmission subject would then need to be communicated to the indexed writers.
Perhaps a possible way to handle this would be to use a RWMutex, which is locked on the root writer creation and unlocked once the handshake is complete. Indexed parameter writers Writes would then start with RLocking that shared mutex and block until the handshake is complete. We could also change init field to atomic.Bool here perhaps, which would let the indexed writers first check the atomic and only then attempt to RLock is they loaded false
Currently
Index
method is not implemented inwrpcnats.paramWriter
, because as part of the root subject write it may lazily perform the handshake.The implementation should be updated in such a way that the indexed parameter writers would not be able to write until the root writer performs the handshake. The transmission subject would then need to be communicated to the indexed writers.
Perhaps a possible way to handle this would be to use a
RWMutex
, which is locked on the root writer creation and unlocked once the handshake is complete. Indexed parameter writersWrite
s would then start withRLock
ing that shared mutex and block until the handshake is complete. We could also changeinit
field toatomic.Bool
here perhaps, which would let the indexed writers first check the atomic and only then attempt toRLock
is they loadedfalse
https://github.com/wrpc/wrpc/blob/a75b04391524217058fb4c5284aee224ee8e4464/go/nats/client.go#L193
The text was updated successfully, but these errors were encountered: