D
D
DarkByte20152016-04-22 18:51:15
C++ / C#
DarkByte2015, 2016-04-22 18:51:15

Why is a function declared on the server as asynchronous generated on the client as synchronous?

On the server, I declare a function in the callback:
Task<double> OnCalculate(ClientJob job)
But on the client, when I add a link to the service, it is already generated as:
double OnCalculate(ClientJob job)
What the hell is this and how to avoid this? It is very important for me that it is asynchronous on the client. Because if it is not asynchronous, then the interface hangs for the duration of the calculations.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mayorovp, 2016-04-22
@DarkByte2015

About "what the fuck" - it's normal. The fact is that only the double type is responsible for the data transmitted over the network, and Task is just a method of calling (synchronous or asynchronous).
You can look in the Service Reference settings for the key that is responsible for generating callback interfaces. I don't remember exactly if it can be controlled.
Another option, in case you don't find it, is to simply fix double to Task<double> manually.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question