Split signal segmenter and reassembler. (#3805)

* Split signal segmenter and reassembler.

As reassembler may need to run a goroutine for pruning, splitting it up
so that we do not have unnecessary goroutines. Keeping the UT unified
though.

Also, for now, trying to see if `Prune` can be called from external
place to avoid creating a goroutine and have extra state/functions to
close the reassembler and clean up goroutine etc. May still have to do
goroutine, but have not created one for now.

* fix: do not increase packetId for each fragment of a packet
This commit is contained in:
Raja Subramanian
2025-07-21 11:10:20 +05:30
committed by GitHub
parent 0a1bfd3092
commit 1c99b9ad5f
8 changed files with 176 additions and 78 deletions
+3 -3
View File
@@ -40,14 +40,14 @@ type signallerv2Async struct {
*signallerAsyncBase
signalFragment *SignalFragment
signalSegmenter *SignalSegmenter
}
func NewSignallerv2Async(params Signallerv2AsyncParams) ParticipantSignaller {
return &signallerv2Async{
params: params,
signallerAsyncBase: newSignallerAsyncBase(signallerAsyncBaseParams{Logger: params.Logger}),
signalFragment: NewSignalFragment(SignalFragmentParams{
signalSegmenter: NewSignalSegmenter(SignalSegmenterParams{
Logger: params.Logger,
}),
}
@@ -100,7 +100,7 @@ func (s *signallerv2Async) WriteMessage(msg proto.Message) error {
)
}
} else {
fragments = s.signalFragment.Segment(marshaled)
fragments = s.signalSegmenter.Segment(marshaled)
}
sendMsg := func(m proto.Message) error {