Created
December 8, 2011 00:28
-
-
Save Buildstarted/1445495 to your computer and use it in GitHub Desktop.
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 HomeController : Controller | |
{ | |
// | |
// GET: /Home/ | |
private IEventStream stream; | |
public HomeController(IEventStream stream) | |
{ | |
this.stream = stream; | |
} | |
public ActionResult Index() | |
{ | |
Task.Factory.StartNew(() => { | |
//wait 5 seconds then send the messages | |
System.Threading.Thread.Sleep(5000); | |
stream.Send("this is a string event"); | |
stream.Send("title-description", new { Title = "Titlebar", Description = "This is a more complex type" }); | |
stream.Send(new Profile { Name = "Ben Dornis", Bio = "This is a biography"}); | |
}); | |
return View(); | |
} | |
} | |
public class Profile | |
{ | |
public string Name { get; set; } | |
public string Bio { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment