From c9f201773e5af7c1f2875eff407c3679115874f4 Mon Sep 17 00:00:00 2001 From: Fang Date: Tue, 1 May 2018 01:08:09 +0200 Subject: [PATCH] Regularly poll filter for changes. --- app/constitution.hoon | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/constitution.hoon b/app/constitution.hoon index dbc11d3f13..d66a09e19f 100644 --- a/app/constitution.hoon +++ b/app/constitution.hoon @@ -22,6 +22,7 @@ ++ card :: side-effect $% [%peer wire gill:gall path] [%hiss wire (unit user:eyre) mark [%hiss hiss]] + [%wait wire @da] == -- :: @@ -113,6 +114,11 @@ :+ /filter `'poll filter' [%eth-get-filter-changes filter] :: + ++ ta-wait-poll + %- ta-card + ::NOTE may adjust wrt filter timeout + [%wait /poll (add now.bol ~m4)] + :: :: ++ ta-init ta-new-filter :: @@ -142,7 +148,7 @@ +> ~& %filter-timed-out--recreating ta-new-filter - ::TODO kick for poll + =. +> ta-wait-poll ?> ?=(%a -.res.rep) =* changes p.res.rep ~& [%filter-changes (lent changes)] @@ -402,6 +408,11 @@ ~& (turn t (cury wash [0 80])) [~ +>.$] :: +:: when we get the timer: poll filter +++ wake-poll + |= [w=wire ~] + ta-save:ta-poll-filter:ta +:: :: when we get a new filter: read it, kick timer :: when we get log or poll results: apply them ++ sigh-json-rpc-response-filter