Esempio n. 1
0
 private V4EventList ReadFirehose(string id, int?maxMessages = null)
 {
     return(ApiExecutor.Execute(
                _firehoseApi.V4FirehoseIdReadGet,
                id, AuthTokens.SessionToken, AuthTokens.KeyManagerToken,
                maxMessages));
 }
Esempio n. 2
0
        /// <summary>
        /// Creates a firehose.
        /// </summary>
        /// <returns>The ID of the firehose.</returns>
        public string CreateFirehose()
        {
            var firehose = ApiExecutor.Execute(_firehoseApi.V4FirehoseCreatePost, AuthTokens.SessionToken,
                                               AuthTokens.KeyManagerToken);

            return(firehose.Id);
        }
Esempio n. 3
0
 /// <summary>
 /// Creates a datafeed.
 /// </summary>
 /// <returns>The ID of the datafeed.</returns>
 public string CreateDatafeed()
 {
     try
     {
         var datafeed = ApiExecutor.Execute(_datafeedApi.V4CreateAsync, AuthTokens.SessionToken, AuthTokens.KeyManagerToken);
         return(datafeed.Id);
     }
     catch (Exception e)
     {
         _log?.LogError(0, e, "An error has occured while trying to create a datafeed.");
         throw;
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Creates a firehose.
 /// </summary>
 /// <returns>The ID of the firehose.</returns>
 public string CreateFirehose()
 {
     try
     {
         var firehose = ApiExecutor.Execute(_firehoseApi.V4CreateAsync, AuthTokens.SessionToken,
                                            AuthTokens.KeyManagerToken);
         return(firehose.Id);
     }
     catch (Exception e)
     {
         _log?.LogError(0, e, "An error has occured while trying to create a firehose.");
         throw;
     }
 }
Esempio n. 5
0
        private V4EventList ReadDatafeed(string id, int?maxMessages = null)
        {
            _log?.LogDebug("Waiting for messages on datafeed id = {id}", id);

            // I suspect that when the pod is rebooted, V4DatafeedIdReadGet hangs.
            // This shouldn't happen as the HTTP call should timeout, so something
            // odd is going on and hopefully this will help sort things out.

            var task = Task.Run(() =>
            {
                return(ApiExecutor.Execute(
                           _datafeedApi.V4DatafeedIdReadGet,
                           id, AuthTokens.SessionToken, AuthTokens.KeyManagerToken,
                           maxMessages));
            });

            if (task.Wait(TimeSpan.FromSeconds(110)))
            {
                return(task.Result);
            } // this timed out
            throw new TimeoutException($"Datafeed read call timed out waiting for {id}");
        }
Esempio n. 6
0
        /// <summary>
        /// Creates a datafeed.
        /// </summary>
        /// <returns>The ID of the datafeed.</returns>
        public string CreateDatafeed()
        {
            var datafeed = ApiExecutor.Execute(_datafeedApi.V4DatafeedCreatePost, AuthTokens.SessionToken, AuthTokens.KeyManagerToken);

            return(datafeed.Id);
        }
Esempio n. 7
0
 private V2MessageList ReadDatafeed(string id, int?maxMessages = null)
 {
     return(ApiExecutor.Execute(_datafeedApi.V2DatafeedIdReadGet, id, AuthTokens.SessionToken, AuthTokens.KeyManagerToken, maxMessages));
 }