Added request retry modes

This commit is contained in:
RogueException
2016-12-16 09:13:42 -04:00
parent 3927758b70
commit 1efcd3daf6
14 changed files with 98 additions and 39 deletions

View File

@@ -1,11 +1,18 @@
namespace Discord
using System.Threading;
namespace Discord
{
public class RequestOptions
{
public static RequestOptions Default => new RequestOptions();
/// <summary> The max time, in milliseconds, to wait for this request to complete. If null, a request will not time out. If a rate limit has been triggered for this request's bucket and will not be unpaused in time, this request will fail immediately. </summary>
/// <summary>
/// The max time, in milliseconds, to wait for this request to complete. If null, a request will not time out.
/// If a rate limit has been triggered for this request's bucket and will not be unpaused in time, this request will fail immediately.
/// </summary>
public int? Timeout { get; set; }
public CancellationToken CancelToken { get; set; } = CancellationToken.None;
public RetryMode? RetryMode { get; set; }
public bool HeaderOnly { get; internal set; }
internal bool IgnoreState { get; set; }
@@ -13,7 +20,7 @@
internal bool IsClientBucket { get; set; }
internal static RequestOptions CreateOrClone(RequestOptions options)
{
{
if (options == null)
return new RequestOptions();
else