File tree Expand file tree Collapse file tree 2 files changed +0
-31
lines changed
Expand file tree Collapse file tree 2 files changed +0
-31
lines changed Original file line number Diff line number Diff line change @@ -27,33 +27,6 @@ let remove_document store uri =
2727 let + () = Document. close doc in
2828 Table. remove store uri)
2929
30- let unregister_promotions t uris =
31- let * () = Fiber. return () in
32- List. filter uris ~f: (fun uri ->
33- match Table. find t.db uri with
34- | None -> false
35- | Some doc ->
36- let doc = { doc with promotions = doc.promotions - 1 } in
37- let unsubscribe = doc.promotions = 0 in
38- if unsubscribe && doc.document = None then
39- Table. remove t.db uri
40- else
41- Table. set t.db uri doc;
42- unsubscribe)
43- |> unregister_request t
44-
45- let register_promotions t uris =
46- let * () = Fiber. return () in
47- List. filter uris ~f: (fun uri ->
48- let doc, subscribe =
49- match Table. find t.db uri with
50- | None -> ({ document = None ; promotions = 0 }, true )
51- | Some doc -> ({ doc with promotions = doc.promotions + 1 }, false )
52- in
53- Table. set t.db uri doc;
54- subscribe)
55- |> register_request t
56-
5730let close t =
5831 Fiber. of_thunk (fun () ->
5932 let docs = Table. fold t ~init: [] ~f: (fun doc acc -> doc :: acc) in
Original file line number Diff line number Diff line change @@ -12,8 +12,4 @@ val get_opt : t -> Uri.t -> Document.t option
1212
1313val remove_document : t -> Uri .t -> unit Fiber .t
1414
15- val unregister_promotions : t -> Uri .t list -> unit Fiber .t
16-
17- val register_promotions : t -> Uri .t list -> unit Fiber .t
18-
1915val close : t -> unit Fiber .t
You can’t perform that action at this time.
0 commit comments