link-store: support "all unseen" scry

Instead of forcing clients to scry at every path, they can now scry for
all paths at once.
This commit is contained in:
Fang 2020-02-14 01:57:58 +01:00
parent fafe4cf2bd
commit 1f4a41e550
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -40,6 +40,10 @@
:: ::
:: scry-only paths: :: scry-only paths:
:: ::
::
:: (map path (set url))
:: /unseen the ones we haven't seen yet
::
:: (set url) :: (set url)
:: /unseen/some-path the ones we haven't seen here yet :: /unseen/some-path the ones we haven't seen here yet
:: ::
@ -154,6 +158,9 @@
:: ::
[%x %seen @ ^] [%x %seen @ ^]
``noun+!>((is-seen:do t.t.path)) ``noun+!>((is-seen:do t.t.path))
::
[%x %unseen ~]
``noun+!>(get-all-unseen:do)
:: ::
[%x %unseen ^] [%x %unseen ^]
``noun+!>((get-unseen:do t.t.path)) ``noun+!>((get-unseen:do t.t.path))
@ -382,6 +389,12 @@
%+ ~(put by *(map ^path submissions)) path %+ ~(put by *(map ^path submissions)) path
submissions:(~(gut by by-group) path *links) submissions:(~(gut by by-group) path *links)
:: ::
++ get-all-unseen
^- (jug path url)
%- ~(rut by by-group)
|= [=path *]
(get-unseen path)
::
++ get-unseen ++ get-unseen
|= =path |= =path
^- (set url) ^- (set url)