protected static async Task<IApiResult<IEnumerable<long>>> RetrieveCursoredResult(ApiAccessor accessor, Func<ApiAccessor, long, Task<IApiResult<ICursorResult<IEnumerable<long>>>>> func, Action<Exception> exceptionHandler, CancellationToken token) { var resultList = new List<long>(); CursorResultExtension.ApiContinuationReader<IEnumerable<long>> reader = () => accessor.ReadCursorApi(func, token); var lastRateLimit = RateLimitDescription.Empty; while (reader != null) { try { var result = await reader().ConfigureAwait(false); resultList.AddRange(result.Item1.Result); lastRateLimit = result.Item1.RateLimit; reader = result.Item2; } catch (Exception ex) { exceptionHandler(ex); break; } } return ApiResult.Create(resultList, lastRateLimit); }
public DirectMessagesReceiver([NotNull] ApiAccessor accessor, [NotNull] Action<TwitterStatus> handler, [CanBeNull] Action<Exception> exceptionHandler, int receiveCount = 100) : base(handler, exceptionHandler) { if (accessor == null) throw new ArgumentNullException(nameof(accessor)); _accessor = accessor; _receiveCount = receiveCount; }
public FriendsReceiver([NotNull] ApiAccessor accessor, [NotNull] Action<IEnumerable<long>> handler, [CanBeNull] Action<Exception> exceptionHandler) : base(handler, exceptionHandler) { if (accessor == null) throw new ArgumentNullException(nameof(accessor)); _accessor = accessor; }
public SearchReceiver([NotNull] ApiAccessor accessor, Action<TwitterStatus> handler, [CanBeNull] Action<Exception> exceptionHandler, [NotNull] SearchParameter parameter) : base(handler, exceptionHandler) { if (accessor == null) throw new ArgumentNullException(nameof(accessor)); if (parameter == null) throw new ArgumentNullException(nameof(parameter)); _accessor = accessor; _parameter = parameter; }
public MentionsReceiver([NotNull] ApiAccessor accessor, [NotNull] Action<TwitterStatus> handler, [CanBeNull] Action<Exception> exceptionHandler, int receiveCount = 100, bool includeRetweets = false) : base(handler, exceptionHandler) { if (accessor == null) throw new ArgumentNullException(nameof(accessor)); _accessor = accessor; _receiveCount = receiveCount; _includeRetweets = includeRetweets; }
public SavedSearchesReceiver([NotNull] ApiAccessor accessor, [NotNull] Action<IEnumerable<TwitterSavedSearch>> handler, [CanBeNull] Action<Exception> exceptionHandler) : base(exceptionHandler) { _accessor = accessor; _handler = handler; if (accessor == null) throw new ArgumentNullException(nameof(accessor)); if (handler == null) throw new ArgumentNullException(nameof(handler)); }
public UserInfoReceiver(ApiAccessor accessor, [NotNull] Action<TwitterUser> handler, [CanBeNull] Action<Exception> exceptionHandler, [NotNull] UserParameter target) : base(exceptionHandler) { if (handler == null) throw new ArgumentNullException(nameof(handler)); if (target == null) throw new ArgumentNullException(nameof(target)); _accessor = accessor; _handler = handler; _target = target; }
public UserTimelineReceiver([NotNull] ApiAccessor accessor, [NotNull] Action<TwitterStatus> handler, [CanBeNull] Action<Exception> exceptionHandler, [NotNull] UserParameter target, int receiveCount = 100, bool excludeReplies = false, bool includeRetweets = true) : base(handler, exceptionHandler) { if (accessor == null) throw new ArgumentNullException(nameof(accessor)); if (target == null) throw new ArgumentNullException(nameof(target)); _accessor = accessor; _target = target; _receiveCount = receiveCount; _excludeReplies = excludeReplies; _includeRetweets = includeRetweets; }
public UserStreamReceiver(ApiAccessor accessor, IStreamHandler handler) { _accessor = accessor; _handler = handler; ChangeState(StreamState.Disconnected); // set default values to parameters StallWarnings = true; StreamFilterLevel = StreamFilterLevel.None; _currentState = StreamState.Connected; _backoffMode = BackoffMode.None; _backoffWait = 0; _hardErrorCount = 0; }
public StreamWaitMessage(ApiAccessor accessor, long waitSec) { Accessor = accessor; WaitSec = waitSec; }
public StreamErrorMessage(ApiAccessor accessor, HttpStatusCode hcode, TwitterErrorCode? tcode) { Accessor = accessor; Code = hcode; TwitterErrorCode = tcode; }
public SalesApiAccessor(ISalesNotifier accountSummaryNotifier) { this.AccountSummaryNotifier = accountSummaryNotifier; this.clientAccountApi = ApiAccessor.Get <IClientAccountApi>(); }
public UniquesUpdater(HttpClient httpClient, string basePath) { _apiAccessor = new ApiAccessor(httpClient); _savePath = basePath + "PoESkillTree.Engine.GameModel/Data/Uniques.xml"; }