Skip to content

Commit

Permalink
remove unnecessary prop
Browse files Browse the repository at this point in the history
  • Loading branch information
majocha committed Nov 15, 2024
1 parent e46f989 commit 4c4c9e9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/Compiler/Facilities/AsyncMemoize.fs
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T

member this.Count = lock cache <| fun () -> cache.Count

member _.Updating = false

member this.DebuggerDisplay =

let (|Running|_|) (job: Job<_>) = job.Task |> Option.filter (_.IsCompleted >> not)
Expand Down
2 changes: 0 additions & 2 deletions src/Compiler/Facilities/AsyncMemoize.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T

member Count: int

member Updating: bool

/// A drop-in replacement for AsyncMemoize that disables caching and just runs the computation every time.
type internal AsyncMemoizeDisabled<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVersion: equality> =

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,13 @@ let internal recordAllEvents groupBy =
let mutable cache : AsyncMemoize<_,_,_> option = None
let events = ConcurrentQueue()

let waitForIdle() = SpinWait.SpinUntil(fun () -> not cache.Value.Updating)

let observe (getCache: CompilerCaches -> AsyncMemoize<_,_,_>) (checker: FSharpChecker) =
cache <- Some (getCache checker.Caches)
waitForIdle()
cache.Value.Event
|> Event.map (fun (e, k) -> groupBy k, e)
|> Event.add events.Enqueue

let getEvents () =
waitForIdle()
events |> List.ofSeq

observe, getEvents
Expand Down

0 comments on commit 4c4c9e9

Please sign in to comment.