MCPcopy
hub / github.com/NVIDIA/aistore / NewMsgStream

Function NewMsgStream

transport/api.go:181–194  ·  view source on GitHub ↗

message stream //

(client Client, dstURL, dstID string)

Source from the content-addressed store, hash-verified

179////////////////////
180
181func NewMsgStream(client Client, dstURL, dstID string) (s *MsgStream) {
182 extra := &Extra{Config: cmn.GCO.Get()}
183 s = &MsgStream{streamBase: *newStreamBase(client, dstURL, dstID, extra)}
184 s.streamBase.streamer = s
185
186 burst := burst(extra.Config) // num messages the caller can post without blocking
187 s.workCh = make(chan *Msg, burst) // Send Qeueue or SQ
188
189 s.wg.Add(1)
190 go s.sendLoop(dryrun())
191
192 gc.ctrlCh <- ctrl{&s.streamBase, true /* collect */}
193 return
194}
195
196func (s *MsgStream) Send(msg *Msg) (err error) {
197 debug.Assert(len(msg.Body) < len(s.maxheader)-int(unsafe.Sizeof(Msg{})))

Callers 2

Example_msgFunction · 0.92
Test_MsgDryRunFunction · 0.92

Calls 6

newStreamBaseFunction · 0.85
burstFunction · 0.85
dryrunFunction · 0.85
sendLoopMethod · 0.80
GetMethod · 0.65
AddMethod · 0.65

Tested by 2

Example_msgFunction · 0.74
Test_MsgDryRunFunction · 0.74