MCPcopy
hub / github.com/wavetermdev/waveterm / SendWaveObjUpdate

Function SendWaveObjUpdate

pkg/wcore/wcore.go:108–127  ·  view source on GitHub ↗
(oref waveobj.ORef)

Source from the content-addressed store, hash-verified

106}
107
108func SendWaveObjUpdate(oref waveobj.ORef) {
109 ctx, cancelFn := context.WithTimeout(context.Background(), 2*time.Second)
110 defer cancelFn()
111 // send a waveobj:update event
112 waveObj, err := wstore.DBGetORef(ctx, oref)
113 if err != nil {
114 log.Printf("error getting object for update event: %v", err)
115 return
116 }
117 wps.Broker.Publish(wps.WaveEvent{
118 Event: wps.Event_WaveObjUpdate,
119 Scopes: []string{oref.String()},
120 Data: waveobj.WaveObjUpdate{
121 UpdateType: waveobj.UpdateType_Update,
122 OType: waveObj.GetOType(),
123 OID: waveobj.GetOID(waveObj),
124 Obj: waveObj,
125 },
126 })
127}
128
129func ResolveBlockIdFromPrefix(ctx context.Context, tabId string, blockIdPrefix string) (string, error) {
130 if len(blockIdPrefix) != 8 {

Callers 6

UpdateTabNameCommandMethod · 0.92
SetMetaCommandMethod · 0.92
AttachJobToBlockFunction · 0.92
DetachJobFromBlockFunction · 0.92

Calls 5

DBGetORefFunction · 0.92
GetOIDFunction · 0.92
PublishMethod · 0.80
GetOTypeMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected