Skip to content
This repository has been archived by the owner on Dec 20, 2019. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dajuric authored Jan 3, 2018
1 parent 17e56e3 commit 7388e7f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ interface IProgressAPI
class TaskAPI //:ITaskAPI
{
public async Task<int> LongRunningTask(int a, int b) {

for (var p = 0; p <= 100; p += 5) {
await Task.Delay(250);
//select only those connections which are associated with 'IProgressAPI' and with 'this' object.
await RPC.For<IProgressAPI>(this).CallAsync(x => x.WriteProgress((float)p / 100));
await RPC.For<IProgressAPI>(this)
.CallAsync(x => x.WriteProgress((float)p / 100));
}

return a + b;
Expand Down Expand Up @@ -88,7 +90,8 @@ Client.ConnectAsync("ws://localhost:8000/", CancellationToken.None,
.Wait(0);
...
//make an RPC
var r = await RPC.For<ITaskAPI>().CallAsync(x => LongRunningTask(5, 3));
var r = await RPC.For<ITaskAPI>()
.CallAsync(x => LongRunningTask(5, 3));
Console.WriteLine("Result: " + r.First());

/*
Expand Down

0 comments on commit 7388e7f

Please sign in to comment.