anchor.diff:                          tcs.SetException(t.Exception)
                       else tcs.SetResult (t.Result)))
                 Priority = prio }
  -        let handle = Guid.NewGuid()
  -        let res = queue.TryAdd(handle, work)
  -        assert res
  -        { Handle = handle; Work = work; TaskSource = tcs }
  -    let rec private getNext ({ DynamicQueue = queue } as d) =
  -        if queue.Count = 0 then None
  -        else
  -            let min =
  -                // cannot minBy as the sequence might be empty by now.
  -                queue |> Seq.fold (fun currentMin kv ->
  -                    match currentMin with
  -                    | None -> Some (kv.Key, kv.Value)
  -                    | Some (minKey, min) when kv.Value.Priority < min.Priority -> Some (kv.Key, kv.Value)
  -                    | min -> min) None
  -            match min with
  -            | Some (minKey, min) ->
  -                match queue.TryRemove(minKey) with
  -                | true, min ->
  -                    Some min
  -                | _ ->
  -                    getNext d
  -            | None -> getNext d
  -    let startProcessing (cts:CancellationToken) ({ DynamicQueue = queue } as q) =
  +        q.AddWork work
  +        { Work = work; TaskSource = tcs }
  +    let startProcessing (ct:CancellationToken) ({ DynamicQueue = queue } as q) =
           async {
  -            while not cts.IsCancellationRequested do
  -                match getNext q with
  -                | None -> do! Async.Sleep 10
  +            while not ct.IsCancellationRequested do
  +                let! work = q.GetWork(ct) |> Async.AwaitTask
  +                match work with
                   | Some work ->
  -                    do! work.StartWork().ContinueWith(fun (t:System.Threading.Tasks.Task) ->()) |> Async.AwaitTask
  +                    do! work.StartWork(ct).ContinueWith(fun (t:System.Threading.Tasks.Task) -> ()) |> Async.AwaitTask
  +                | None -> ()
           }
           |> Async.StartAsTask
   
  
positive.code: 
  type RequestWork =
      private
          { StartWork : unit -> System.Threading.Tasks.Task
            mutable Priority : WorkPriority }
  
  type WorkHandle<'a> = private { Handle : Guid; Work : RequestWork; TaskSource : TaskCompletionSource<'a> }
  and ResolverRequestQueue =
      private { DynamicQueue : System.Collections.Concurrent.ConcurrentDictionary<Guid, RequestWork> }
  module ResolverRequestQueue =
      open System.Threading
  
      let Create() = { DynamicQueue = new System.Collections.Concurrent.ConcurrentDictionary<Guid, RequestWork>(); }
      let addWork prio (f: unit -> System.Threading.Tasks.Task<'a>) ({ DynamicQueue = queue } as q) =
          let tcs = new TaskCompletionSource<_>()
          let work =
              { StartWork = (fun () ->
                  let t =
                      try
                          f()
                      with e -> 
                          //Task.FromException (e)
                          let tcs = new TaskCompletionSource<_>()
  
negative.code:         let key = (sources, packageName, semVer)
          startedGetPackageDetailsRequests.GetOrAdd (key, fun _ ->
              workerQueue
              |> ResolverRequestQueue.addWork WorkPriority.BackgroundWork (fun ct ->
                  (getPackageDetailsRaw sources groupName packageName semVer : Async<PackageDetails>)
                      |> Async.StartAsTask))
      let getPackageDetailsBlock sources groupName packageName semVer =
  