Skip to content

Instantly share code, notes, and snippets.

@luisrudge
Created April 9, 2013 19:46
Show Gist options
  • Save luisrudge/5348761 to your computer and use it in GitHub Desktop.
Save luisrudge/5348761 to your computer and use it in GitHub Desktop.
public class Chat : Hub
{
public void LoadPlotData()
{
ThreadPool.QueueUserWorkItem(x => {
var firstPlotData = Db.LoadFirstPlotData();
Clients.Caller.firstPlotDataRetrieved(firstPlotData);
});
ThreadPool.QueueUserWorkItem(x => {
var secondPlotData = Db.LoadSecondPlotData();
Clients.Caller.secondPlotDataRetrieved(secondPlotData);
});
}
public void LoadTableData()
{
ThreadPool.QueueUserWorkItem(x => {
var firstTableData = Db.LoadFirstTableData();
Clients.Caller.firstTableDataRetrieved(firstTableData);
});
ThreadPool.QueueUserWorkItem(x => {
var secondTableData = Db.LoadFirstTableData();
Clients.Caller.secondTableDataRetrieved(secondTableData);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment