使用edge.js,.Net C#模块可以调用流程中的node.js部分,即是否进行反向调用? [英] Using edge.js is it possible for the .Net C# module to call the node.js part of the process, i.e. do the reverse call?

查看:181
本文介绍了使用edge.js,.Net C#模块可以调用流程中的node.js部分,即是否进行反向调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以在Node.js-> C#中看到互操作模型,请在此处.

You can see the interop model for going from Node.js -> C#, here.

我想知道的是,在返回之前,C#代码是否可以从C#调用过程的Node.js部分中的方法?

What I want to know is, can the C# code then make a call to a method in the Node.js part of the process from the C#, before returning?

想像一下您是否打过电话,例如

Imagine if you had a call, like

var webApi = edge.func('/MyDotNetApi.csx');
webApi(function (error, result) { log.('api started'); });

MyDotNetApi.csx返回的位置,但保持套接字侦听器线程运行以处理HTTP请求.现在,如果该过程的Node.js部分保存(不断变化的).Net代码需要访问以包含在其HTTP响应中的信息,那么它可以以某种方式向Node.js索要吗?

where the MyDotNetApi.csx returns, but leaves a socket listener thread running to handle HTTP requests. Now, if the Node.js part of the process holds (ever changing) information which the .Net code needs to access for inclusion in its HTTP responses, can it somehow ask Node.js for it?

推荐答案

可以使用Edge.js从C#调用Node.js,并且

Calling back Node.js from C# with Edge.js is possible and documented.

这篇关于使用edge.js,.Net C#模块可以调用流程中的node.js部分,即是否进行反向调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆