示例#1
0
 public async Task SubscribeToTrollboxAsync()
 {
     if (!ActiveSubscriptions.ContainsKey(SubjectNameTrollbox))
     {
         await WampChannelOpenTask;
         ActiveSubscriptions.Add(SubjectNameTrollbox, WampChannel.RealmProxy.Services.GetSubject(SubjectNameTrollbox).Subscribe(x => ProcessMessageTrollbox(x.Arguments)));
     }
 }
示例#2
0
 public async Task SubscribeToTickerAsync()
 {
     try {
         if (!ActiveSubscriptions.ContainsKey(SubjectNameTicker))
         {
             await WampChannelOpenTask;
             ActiveSubscriptions.Add(SubjectNameTicker, WampChannel.RealmProxy.Services.GetSubject(SubjectNameTicker).Subscribe(x => ProcessMessageTicker(x.Arguments)));
         }
     }
     catch (Exception ex) {
         Console.WriteLine("WAMP EXCEPTION (SubscribeToTickerAsync): " + ex.Message);
     }
 }
示例#3
0
 public async Task SubscribeToTickerAsync()
 {
     if (!ActiveSubscriptions.ContainsKey(SubjectNameTicker))
     {
         try
         {
             await WampChannelOpenTask;
             ActiveSubscriptions.Add(SubjectNameTicker,
                                     WampChannel.RealmProxy.Services.GetSubject(SubjectNameTicker)
                                     .Subscribe(x => ProcessMessageTicker(x.Arguments)));
         }
         catch (Exception ex)
         {
             var clientError = ClientChannelHttpException.CreateFrom(ex);
             if (clientError != null)
             {
                 throw clientError;
             }
             throw;
         }
     }
 }