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

Method EventSubCommand

pkg/wshrpc/wshserver/wshserver.go:522–529  ·  view source on GitHub ↗
(ctx context.Context, data wps.SubscriptionRequest)

Source from the content-addressed store, hash-verified

520}
521
522func (ws *WshServer) EventSubCommand(ctx context.Context, data wps.SubscriptionRequest) error {
523 rpcSource := wshutil.GetRpcSourceFromContext(ctx)
524 if rpcSource == "" {
525 return fmt.Errorf("no rpc source set")
526 }
527 wps.Broker.Subscribe(rpcSource, data)
528 return nil
529}
530
531func (ws *WshServer) EventUnsubCommand(ctx context.Context, data string) error {
532 rpcSource := wshutil.GetRpcSourceFromContext(ctx)

Callers

nothing calls this directly

Calls 2

GetRpcSourceFromContextFunction · 0.92
SubscribeMethod · 0.80

Tested by

no test coverage detected