Exemplo n.º 1
0
 public CopyTask(CopyOperationBase request, int priority, CancellationToken timeoutToken, CancellationToken cancelToken)
 {
     Request      = request;
     Priority     = priority;
     Stopwatch    = StopwatchSlim.Start();
     TimeoutToken = timeoutToken;
     CancelToken  = cancelToken;
 }
Exemplo n.º 2
0
 public int Prioritize(CopyOperationBase request)
 {
     if (request is OutboundPullCopy outboundPullRequest)
     {
         return(GetPriority(
                    reason: outboundPullRequest.Reason,
                    attempt: outboundPullRequest.Attempt,
                    proactiveLocationSource: ProactiveCopyLocationSource.None));
     }
     else if (request is OutboundPushCopyBase outboundPushRequest)
     {
         return(GetPriority(
                    reason: outboundPushRequest.Reason,
                    attempt: outboundPushRequest.Attempt,
                    proactiveLocationSource: outboundPushRequest.LocationSource));
     }
     else
     {
         throw new InvalidOperationException($"Attempt to prioritize a request with unhandled type `{request.GetType()}`");
     }
 }
Exemplo n.º 3
0
 public CopyTask(CopyOperationBase request, int priority)
 {
     Request   = request;
     Priority  = priority;
     Stopwatch = StopwatchSlim.Start();
 }