Quantcast
Channel: Active questions tagged zeromq - Stack Overflow
Viewing all articles
Browse latest Browse all 208

.Net Zero MQ/NET MQ creates new NetMQRuntime() for each request

$
0
0

I am using the Net MQ (Zero MQ) async implementation described in their docs: https://netmq.readthedocs.io/en/latest/async-await/

I have implemented this on my .aspx page which processes each request and sends to the server. This all works fine but I am aware that I am creating a new runtime for each request - this seems inefficient - is there another way?

Public Shared Async Function HandleRequest    Dim tcs As New TaskCompletionSource(Of String)()    Using runtime As New NetMQRuntime()        runtime.Run(StartAsync(tcs, requestStr))    End Using    Dim response As String = Await tcs.TaskEnd FunctionPrivate Shared Async Function StartAsync()'send to server, receive response.    ..    ..    Return responseEnd Function

Viewing all articles
Browse latest Browse all 208


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>