btc: provider now has one heartbeat for all clients
~& >>> "btc-provider: blocked client {<src.bowl>}"
[~[[%give %kick ~ ~]] this]
~& > "btc-provider: accepted client {<src.bowl>}"
- :- do-ping:hc
+ :- [do-ping:hc]~
this(clients.host-info (~(put in clients.host-info) src.bowl))
::
++ on-arvo
:: check for connectivity every 30 seconds
::
?: ?=([%ping-timer *] wire)
- [do-ping:hc this]
+ :_ this
+ :~ do-ping:hc
+ (start-ping-timer:hc ~s30)
+ ==
=^ cards state
?+ +<.sign-arvo (on-arvo:def wire sign-arvo)
%http-response
^- (quip card _state)
?- -.comm
%set-credentials
- :- do-ping
- state(host-info [api-url.comm connected=%.n network.comm block=0 clients=*(set ship)])
+ :- :~ do-ping
+ (start-ping-timer ~s30)
+ ==
+ %= state
+ host-info
+ [api-url.comm connected=%.n network.comm block=0 clients=*(set ship)]
+ ==
::
%add-whitelist
?- -.wt.comm
[%pass /ping-timer %arvo %b %wait (add now.bowl interval)]
::
++ do-ping
- ^- (list card)
+ ^- card
=/ act=action [%ping ~]
- :~ :* %pass /ping/[(scot %da now.bowl)] %agent
+ :* %pass /ping/[(scot %da now.bowl)] %agent
[our.bowl %btc-provider] %poke
%btc-provider-action !>(act)
==
- (start-ping-timer ~s30)
- ==
--
