当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript credentials.createInsecure方法代码示例

本文整理汇总了TypeScript中grpc.credentials.createInsecure方法的典型用法代码示例。如果您正苦于以下问题:TypeScript credentials.createInsecure方法的具体用法?TypeScript credentials.createInsecure怎么用?TypeScript credentials.createInsecure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在grpc.credentials的用法示例。


在下文中一共展示了credentials.createInsecure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: main

function main() {

  let dispatch = new slack.Dispatch('slack:50051', grpc.credentials.createInsecure());

  chatEventEmitter.on('INCOMING_MESSAGE', () => {
    // console.log('SLACK SERVICE INCOMING_MESSAGE');
  });

  chatEventEmitter.on('NEW_CONVERSATION', (channelRequest) => {
    var name = channelRequest.channel_name.toString()
    let channelRequest2 = {
      channel_name: name
    };

    // console.log('SENDING: ', channelRequest2);

    dispatch.createChannel(channelRequest2, (err, slackChannel) => {
      // console.log('GRPC_ERR: ', err);
      // console.log('GRPC_RES: ', slackChannel);
    });
  });
}
开发者ID:sirbabelot,项目名称:babelot-server,代码行数:22,代码来源:index.ts

示例2: Initialise

let ExportedMethods = {
  async Initialise() {
    // console.log('init is entered')
    if (initInProgress) {
      // console.log('init is already in progress, waiting until the other one completes')
      await checkPortSet()
      // console.log('init is complete, returning to normal process')
      return
    }
    initInProgress = true
    console.log('init is called')
    let feapiport = await ipc.callMain('GetFrontendAPIPort')
    feAPIConsumer = new proto.FrontendAPIClient(
      '127.0.0.1:' + feapiport,
      grpc.credentials.createInsecure()
    )
    console.log(feAPIConsumer)
    let clapiserverport = await ipc.callMain('GetClientAPIServerPort')
    await ExportedMethods.SetClientAPIServerPort(clapiserverport)
    ipc.callMain('SetFrontendClientConnInitialised', true)
    Initialised = true
    initInProgress = false
  },
  GetAllBoards(callback: any) {
    WaitUntilFrontendReady(async function() {
      console.log('get all boards is making a call')
      console.log('initstate: ', Initialised)
      if (!Initialised) {
        await ExportedMethods.Initialise()
      }
开发者ID:nehbit,项目名称:aether-public,代码行数:30,代码来源:feapiconsumer.ts


注:本文中的grpc.credentials.createInsecure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。