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

Function InitJobController

pkg/jobcontroller/jobcontroller.go:112–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110)
111
112func InitJobController() {
113 go connReconcileWorker()
114 go jobPruningWorker()
115
116 rpcClient := wshclient.GetBareRpcClient()
117 rpcClient.EventListener.On(wps.Event_RouteUp, handleRouteUpEvent)
118 rpcClient.EventListener.On(wps.Event_RouteDown, handleRouteDownEvent)
119 rpcClient.EventListener.On(wps.Event_ConnChange, handleConnChangeEvent)
120 rpcClient.EventListener.On(wps.Event_BlockClose, handleBlockCloseEvent)
121 wshclient.EventSubCommand(rpcClient, wps.SubscriptionRequest{
122 Event: wps.Event_RouteUp,
123 AllScopes: true,
124 }, nil)
125 wshclient.EventSubCommand(rpcClient, wps.SubscriptionRequest{
126 Event: wps.Event_RouteDown,
127 AllScopes: true,
128 }, nil)
129 wshclient.EventSubCommand(rpcClient, wps.SubscriptionRequest{
130 Event: wps.Event_ConnChange,
131 AllScopes: true,
132 }, nil)
133 wshclient.EventSubCommand(rpcClient, wps.SubscriptionRequest{
134 Event: wps.Event_BlockClose,
135 AllScopes: true,
136 }, nil)
137}
138
139func isJobManagerRunning(job *waveobj.Job) bool {
140 return job.JobManagerStatus == JobManagerStatus_Running

Callers 1

mainFunction · 0.92

Calls 5

GetBareRpcClientFunction · 0.92
EventSubCommandFunction · 0.92
connReconcileWorkerFunction · 0.85
jobPruningWorkerFunction · 0.85
OnMethod · 0.80

Tested by

no test coverage detected