How to show the progress bar to diffrent clients.?
User1 open the website did something the progress bar starts. User2 open the same website that progress bar needs to display here.Ple开发者_StackOverflow社区ase tell me.
I take it you want all users to see the progress bar, should any one user start the process that the progress bar displays?
This is fairly straightforward if you aren't scaling to multiple websites, because you could have a static variable somewhere that all requests can check to see if the operation is ongoing (but be careful with thread syncronisation).
If you are scaling out horizontally, then this "global variable" state would need to be persisted somewhere, or messages sent between each website instance so each one knows that the operation is ongoing/finished.
Example in webpage On_load:
if (OperationController.IsBusy) // Static "global" variable
{
// Display progress bar
}
else
{
// Display controls to start the operation
}
Example of starting the operation:
public void StartOperationButton_OnClick(...)
{
OperationController.StartOperation();
}
精彩评论