本文整理匯總了TypeScript中grid-client-core.Utils.getAutoScalerTopic方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Utils.getAutoScalerTopic方法的具體用法?TypeScript Utils.getAutoScalerTopic怎麽用?TypeScript Utils.getAutoScalerTopic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類grid-client-core.Utils
的用法示例。
在下文中一共展示了Utils.getAutoScalerTopic方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: notifyClientsAutoScalerChanged
notifyClientsAutoScalerChanged() : void {
let msg: GridMessage = {
type: 'autoscaler-changed'
,content: {}
};
this.connectionsManager.dispatchMessage(Utils.getAutoScalerTopic(), {type: 'autoscaler-changed'}, msg);
}
示例2: getUser
res.status(400).json({error: "autoscaler-not-available", error_description: "auto-scaler is not setup for this grid"});
}, autoscalerRouter);
let destAuthRouter = express.Router();
let destAuthHandler = tr.destAuth((req: tr.DestAuthRequest, res: tr.DestAuthResponse): void => {
if (req.authMode === tr.DestAuthMode.Subscribe)
res.accept();
else
res.reject();
});
destAuthRouter.use(Utils.getDispatcherTopic(), destAuthHandler);
destAuthRouter.use(Utils.getJobsTrackingTopic(), destAuthHandler);
destAuthRouter.use(Utils.getConnectionsTopic(), destAuthHandler);
destAuthRouter.use(Utils.getAutoScalerTopic(), destAuthHandler);
destAuthRouter.use('/topic/job', destAuthHandler);
let options: tr.Options = {
connKeepAliveIntervalMS: 10000
,connCookieMaker: (req: express.Request) => {return getUser(req);} // connection cookie is the user
,dispatchMsgOnClientSend: false
,destinationAuthorizeRouter: destAuthRouter
}
let ret = tr.get('/event_stream', options);
router.use('/events', ret.router); // topic subscription endpoint is available at /events/event_stream from this route
let connectionsManager = ret.connectionsManager;
connectionsManager.on('client_connect', (req:express.Request, connection: tr.ITopicConnection) : void => {