Is sequence of events guaranteed in SignalR?

If I have a simple SignalR application that looks like this:

Customer:

chat.client.addMessage = function (message) {
    console.log(message);
};

...

var result = chat.server.send("Hello, World.");
console.log(result);

      

Server Hub:

public int Send(string message)
{
    Clients.All.addMessage(message);
    return 10;
}

      

The result looks like this:

10
Hello, World.

      

I'm not entirely sure which parts of the asynchronous magic work and which ones don't, so I would like to know if this order is guaranteed?

Is it guaranteed to return a server side return value before any server side push messages that might trigger this call?

+3


source to share





All Articles