-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gustavo Armenta
committed
Aug 15, 2013
1 parent
a0331ca
commit e0a561b
Showing
4 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
samples/Microsoft.AspNet.SignalR.Samples/Hubs/Test/LongRunningHub.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.AspNet.SignalR.Samples.Hubs.Test | ||
{ | ||
public class LongRunningHub : Hub | ||
{ | ||
private static ManualResetEvent myEvent = new ManualResetEvent(false); | ||
|
||
public void Set() | ||
{ | ||
myEvent.Set(); | ||
} | ||
|
||
public void Reset() | ||
{ | ||
myEvent.Reset(); | ||
} | ||
|
||
public Task LongRunningMethod(int i) | ||
{ | ||
Clients.Caller.serverIsWaiting(i).Wait(); | ||
|
||
return Task.Run(() => | ||
{ | ||
myEvent.WaitOne(); | ||
}); | ||
} | ||
} | ||
} |
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
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