Skip to content
This repository was archived by the owner on May 10, 2018. It is now read-only.

Commit 4fcfd64

Browse files
author
Elad Zelingher
committed
Fixing another markdown file
1 parent dc0fe8b commit 4fcfd64

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎WAMP1/Getting-started-with-WAMPv1-client.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public interface IAsyncCalculator
6060
```
6161

6262
After that, we can use the channel to get a proxy to this interface, and call its method:
63+
6364
```csharp
6465
ICalculator proxy = channel.GetRpcProxy<ICalculator>();
6566
int five = proxy.Add(2, 3);
@@ -75,6 +76,7 @@ Console.WriteLine("2 + 3 = " + asyncFive.Result);
7576
In order to use pub/sub capabilities, we call channel's GetSubject method: this method has a generic type parameter representing the type of the event published to the Subject. In addition, this method receives the uri of the topic we want to subscribe/publish to.
7677

7778
We first create the event type:
79+
7880
```csharp
7981
public class TopicEvent
8082
{
@@ -95,18 +97,21 @@ public class TopicEvent
9597
```
9698

9799
After that, we can get a proxy to the server's topic:
100+
98101
```csharp
99102
ISubject<TopicEvent> subject =
100103
channel.GetSubject<TopicEvent>(@"http://example.com/simple");
101104
```
102105

103106
Subscribe to it:
107+
104108
```csharp
105109
IDisposable subscription =
106110
subject.Subscribe(x => Console.WriteLine(x));
107111
```
108112

109113
Publish events to it:
114+
110115
```csharp
111116
subject.OnNext(new TopicEvent()
112117
{
@@ -117,11 +122,13 @@ subject.OnNext(new TopicEvent()
117122
```
118123

119124
And unsubscribe from it:
125+
120126
```csharp
121127
subscription.Dispose();
122128
```
123129

124130
### A complete sample
131+
125132
```csharp
126133
using System;
127134
using System.Reactive.Subjects;

0 commit comments

Comments
 (0)