Skip to content

Instantly share code, notes, and snippets.

@davidfowl
Last active December 21, 2015 00:19
Show Gist options
  • Select an option

  • Save davidfowl/6218905 to your computer and use it in GitHub Desktop.

Select an option

Save davidfowl/6218905 to your computer and use it in GitHub Desktop.
Typed hubs?
public class StockTicker : Hub<IStockClient>
{
public async Task UpdatePrice(string message)
{
// All is typed as IStockClient. So is Group(), Client(), Caller etc.
await Clients.All.UpdateStockQuoteAsync("MSFT", 50.00);
}
}
public interface IStockClient
{
Task UpdateStockQuoteAsync(string symbol, double price);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment