Created
July 6, 2012 18:46
-
-
Save phatboyg/3061985 to your computer and use it in GitHub Desktop.
SignalR MT Integration Post
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 Location : | |
Hub | |
{ | |
public Task GetLocation(string truckId) | |
{ | |
Task task = null; | |
Bus.Instance.PublishRequestAsync(new GetLocation { TruckId = truckId }, x => | |
{ | |
task = x.Handle(message => {}); | |
x.SetTimeout(30.Seconds()); | |
}); | |
return task; | |
} | |
} |
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 Location : | |
Hub | |
{ | |
public Task GetLocation(string truckId) | |
{ | |
Task task = null; | |
Bus.Instance.PublishRequestAsync(new GetLocation { TruckId = truckId }, x => | |
{ | |
task = x.Handle(message => {}); | |
x.SetTimeout(30.Seconds()); | |
}); | |
return task.ContinueWith(t => new LocationView(...)); | |
} | |
public class LocationView | |
{ | |
public string TruckId { get; set; } | |
public string Location { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment