Last active
December 21, 2015 00:19
-
-
Save davidfowl/6218905 to your computer and use it in GitHub Desktop.
Typed hubs?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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