當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Utils.getAutoScalerTopic方法代碼示例

本文整理匯總了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);        
 }
開發者ID:wchang28,項目名稱:node-grid-2,代碼行數:7,代碼來源:clientMessaging.ts

示例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 => {
開發者ID:wchang28,項目名稱:node-grid-2,代碼行數:31,代碼來源:index.ts


注:本文中的grid-client-core.Utils.getAutoScalerTopic方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。