Last active
December 17, 2015 10:49
-
-
Save perokvist/5597873 to your computer and use it in GitHub Desktop.
Lab 2 - Instructions
This file contains 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 BroadcastingEventListener : IEventListener | |
{ | |
private readonly IEnumerable<IBroadcast> _broadcasts; | |
public BroadcastingEventListener(IEnumerable<IBroadcast> broadcasts) | |
{ | |
_broadcasts = broadcasts; | |
} | |
public async Task ReceiveAsync(IEnumerable<IEvent> events) | |
{ | |
//Do the stuff | |
} | |
} |
This file contains 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 BroadcastToXXX : IBroadcast | |
{ | |
private readonly IConnectionManager _connectionManager; | |
public BroadcastToCorrelating(IConnectionManager connectionManager) | |
{ | |
_connectionManager = connectionManager; | |
} | |
public async Task WhenAsync(IEvent @event) | |
{ | |
//Do the stuff | |
} | |
} |
This file contains 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 interface IBroadcast | |
{ | |
Task WhenAsync(IEvent @event); | |
} |
This file contains 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
$('#createGame').click(function() { | |
$.ajax({ | |
type: 'POST', | |
url: YourEndPointUrlHere, | |
data: yourDataHere, | |
dataType: 'json', | |
success: function (data) { | |
}, | |
}); | |
}); |
This file contains 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
<script src="/Scripts/toastr.min.js" type="text/javascript"></script> | |
<script src="/Scripts/jquery.signalR-1.1.0.min.js" type="text/javascript"></script> | |
<script src="~/signalr/hubs" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(function () { | |
//Toastr config | |
toastr.options = { positionClass: 'toast-bottom-right' }; | |
// Proxy created on the fly | |
var bhub = $.connection.broadcastHub; | |
// Declare a function on the chat hub so the server can invoke it | |
bhub.client.something = function (e) { | |
toastr.info(e.Title); //Ex | |
}; | |
// Start the connection | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment