Skip to content

Commit 6b0cc2f

Browse files
committed
Added an option to unsubscribe from all live feeds
1 parent 9a9b64d commit 6b0cc2f

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

Diff for: PoloniexApi.Net/LiveTools/Live.Interface.cs

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ public interface ILive
1010
/// <summary>Occurs when someone sends a message on the trollbox.</summary>
1111
event EventHandler<TrollboxMessageEventArgs> OnTrollboxMessage;
1212

13+
/// <summary>Initializes the live feed.</summary>
14+
void Start();
15+
/// <summary>Disposes the live feed.</summary>
16+
void Stop();
17+
1318
/// <summary>Starts the process of receiving price ticker messages.</summary>
1419
Task SubscribeToTickerAsync();
1520
/// <summary>Starts the process of receiving trollbox messages.</summary>

Diff for: PoloniexApi.Net/LiveTools/Live.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,17 @@ public ObservableDictionary<CurrencyPair, MarketData> Tickers {
2828
get { return _tickers; }
2929
}
3030

31-
internal Live()
31+
public void Start()
3232
{
3333
WampChannel = new DefaultWampChannelFactory().CreateJsonChannel(Helper.ApiUrlWssBase, "realm1");
3434
WampChannelOpenTask = WampChannel.Open();
3535
}
3636

37+
public void Stop()
38+
{
39+
WampChannel.Close();
40+
}
41+
3742
public async Task SubscribeToTickerAsync()
3843
{
3944
if (!ActiveSubscriptions.ContainsKey(SubjectNameTicker)) {

Diff for: PoloniexApi.Net/PoloniexApi.Net.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@
7272
<Reference Include="System.Web" />
7373
<Reference Include="WampSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
7474
<SpecificVersion>False</SpecificVersion>
75-
<HintPath>..\packages\WampSharp.1.2.0.1-beta\lib\net45\WampSharp.dll</HintPath>
75+
<HintPath>..\packages\WampSharp.1.2.0.2-beta\lib\net45\WampSharp.dll</HintPath>
7676
</Reference>
7777
<Reference Include="WampSharp.Default, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
7878
<SpecificVersion>False</SpecificVersion>
79-
<HintPath>..\packages\WampSharp.Default.1.2.0.1-beta\lib\net45\WampSharp.Default.dll</HintPath>
79+
<HintPath>..\packages\WampSharp.Default.1.2.0.2-beta\lib\net45\WampSharp.Default.dll</HintPath>
8080
</Reference>
8181
<Reference Include="WebSocket4Net">
8282
<HintPath>..\packages\WebSocket4Net.0.10\lib\net45\WebSocket4Net.dll</HintPath>

Diff for: PoloniexApi.Net/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
// You can specify all the values or you can default the Build and Revision Numbers
3030
// by using the '*' as shown below:
3131
// [assembly: AssemblyVersion("1.0.*")]
32-
[assembly: AssemblyVersion("1.1.2")]
33-
[assembly: AssemblyFileVersion("1.1.2")]
32+
[assembly: AssemblyVersion("1.1.3")]
33+
[assembly: AssemblyFileVersion("1.1.3")]
3434
[assembly: NeutralResourcesLanguageAttribute("en")]

Diff for: PoloniexApi.Net/packages.config

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<package id="Rx-Linq" version="2.2.5" targetFramework="net45" />
1111
<package id="Rx-Main" version="2.2.5" targetFramework="net45" />
1212
<package id="Rx-PlatformServices" version="2.2.5" targetFramework="net45" />
13-
<package id="WampSharp" version="1.2.0.1-beta" targetFramework="net45" />
14-
<package id="WampSharp.Default" version="1.2.0.1-beta" targetFramework="net45" />
13+
<package id="WampSharp" version="1.2.0.2-beta" targetFramework="net45" />
14+
<package id="WampSharp.Default" version="1.2.0.2-beta" targetFramework="net45" />
1515
<package id="WebSocket4Net" version="0.10" targetFramework="net45" />
1616
</packages>

0 commit comments

Comments
 (0)