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?

StackOverflow https://stackoverflow.com/questions/18861687

Pregunta

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

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'); });

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?

¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top