Hi,
Sorry if my terminology fails me, here. I pretty sure it's the reason I can't find an answer (or didn't recognize a valid answer when I had fount it)
I am writing a web based application using SignalR. There will be many (around 350) operators using the system and I need to communicate data changes, as well as data locks (no two operators can have the same record open for edit for eg).
I have several controls that require the connection, so I'm trying to manage a single shared connection script I can include with the script manager.
The startup is simple enough:
var hubPromise, connection, signalrStartDoneFunctions = [];
StartupFunctions.push(function () {
connection = $.connection.adminServicesHub;
hubPromise = connection.hub;
hubPromise.start().done(function () {
$.each(signalrStartDoneFunctions, function () {
this();
});
});
});
The way I have declared client-side functions is with jQuery.extend:
$.extend(connection.client, {
pulseNewUserPanel: pulseNewUserPanelClient,
pulseExistingUserPanel: pulseExistingUserPanelClient
}
I want to be able to declare these per control too. Each instance of the controls should have it's own functions to add.
What is the best way to manage this? Ideally I would like to ensure that they are there before
connection.hub.start()
. That way I can perform some checks on startup and alert the client if I need to.
Can I set these up via an array as I do with the startup functions? Any advice would be helpful. Up until this point I've pretty much got all my answers from google :S
Thanks ^_^
Andy