mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-18 20:31:40 +03:00
aqua: minimum viable remote scry support
Includes a dumb test for -keen.
This commit is contained in:
parent
12ca0f45e5
commit
a2cab52742
@ -46,6 +46,7 @@
|
||||
event-log=(list unix-timed-event)
|
||||
next-events=(qeu unix-event)
|
||||
processing-events=?
|
||||
namespace=(map path song:ames)
|
||||
==
|
||||
--
|
||||
::
|
||||
@ -223,6 +224,16 @@
|
||||
::
|
||||
:: Peek
|
||||
::
|
||||
++ peek-once
|
||||
|= [=view =desk =spur]
|
||||
=/ res (mox +22.snap)
|
||||
?> ?=(%0 -.res)
|
||||
=/ peek p.res
|
||||
=/ pek (slum peek [[~ ~] %| %once view desk spur])
|
||||
=+ ;;(res=(unit (cask [path (cask)])) pek)
|
||||
::NOTE it's an %omen, so we unpack a little bit deeper
|
||||
(bind res (cork tail (cork tail tail)))
|
||||
::
|
||||
++ peek
|
||||
|= p=*
|
||||
=/ res (mox +22.snap)
|
||||
@ -648,6 +659,37 @@
|
||||
=. this thus
|
||||
(publish-effect:(pe who) [/ %restore ~])
|
||||
(pe ~bud) :: XX why ~bud? need an example
|
||||
::
|
||||
%read
|
||||
?~ pier=(~(get by ships.piers) from.ae)
|
||||
(pe from.ae)
|
||||
=/ cash (~(get by namespace.u.pier) path.ae)
|
||||
|-
|
||||
?^ cash
|
||||
?: (gth num.ae (lent u.cash))
|
||||
(pe from.ae)
|
||||
::TODO depends on /ted/aqua/ames behavior in a weird indirect way
|
||||
=/ for=@p `@`(tail for.ae) ::NOTE moons & comets not supported
|
||||
=; task=task-arvo
|
||||
^$(ae [%event for /a/aqua/fine-response task], thus this)
|
||||
:+ %hear `lane:ames`[%| `@`from.ae]
|
||||
^- blob:ames
|
||||
=/ [amp=? =packet:ames]
|
||||
::NOTE dec is important! so dumb!!
|
||||
(decode-packet:ames `@`(snag (dec num.ae) u.cash))
|
||||
::TODO runtime needs to update rcvr field also
|
||||
::NOTE rcvr life is allowed to be wrong
|
||||
(encode-packet:ames amp packet(sndr from.ae, rcvr for))
|
||||
=/ pacs=(unit song:ames)
|
||||
%+ biff
|
||||
(peek-once:(pe from.ae) %ax %$ [%fine %message path.ae])
|
||||
(soft song:ames)
|
||||
?~ pacs (pe from.ae)
|
||||
=. namespace.u.pier
|
||||
(~(put by namespace.u.pier) path.ae u.pacs)
|
||||
=. ships.piers
|
||||
(~(put by ships.piers) from.ae u.pier)
|
||||
$(cash pacs, thus this)
|
||||
::
|
||||
%event
|
||||
~? &(aqua-debug=| !?=(?(%belt %hear) -.q.ue.ae))
|
||||
|
@ -21,10 +21,16 @@
|
||||
[%event who [/a/newt/0v1n.2m9vh %born ~]]~
|
||||
::
|
||||
++ handle-send
|
||||
|= [our=ship now=@da sndr=@p way=wire %send lan=lane:ames pac=@]
|
||||
=, ames
|
||||
|= [our=ship now=@da sndr=@p way=wire %send lan=lane pac=@]
|
||||
^- (list card:agent:gall)
|
||||
=/ rcvr=ship (lane-to-ship lan)
|
||||
=/ hear-lane (ship-to-lane sndr)
|
||||
=/ [ames=? =packet] (decode-packet pac)
|
||||
?: &(!ames !resp==(& (cut 0 [2 1] pac)))
|
||||
=/ [=peep =purr] (decode-request-info `@ux`(rsh 3^64 content.packet))
|
||||
%+ emit-aqua-events our
|
||||
[%read [rcvr path.peep] [hear-lane num.peep]]~
|
||||
%+ emit-aqua-events our
|
||||
[%event rcvr /a/newt/0v1n.2m9vh %hear hear-lane pac]~
|
||||
:: +lane-to-ship: decode a ship from an aqua lane
|
||||
|
13
pkg/arvo/ted/ph/keen.hoon
Normal file
13
pkg/arvo/ted/ph/keen.hoon
Normal file
@ -0,0 +1,13 @@
|
||||
/- spider
|
||||
/+ *ph-io
|
||||
=, strand=strand:spider
|
||||
^- thread:spider
|
||||
|= vase
|
||||
=/ m (strand ,vase)
|
||||
;< ~ bind:m start-simple
|
||||
;< ~ bind:m (init-ship ~bud &)
|
||||
;< ~ bind:m (init-ship ~dev &)
|
||||
;< ~ bind:m (dojo ~bud "-keen /cx/~dev/kids/1/desk/bill")
|
||||
;< ~ bind:m (wait-for-output ~bud "[ ~")
|
||||
;< ~ bind:m end
|
||||
(pure:m *vase)
|
@ -41,6 +41,7 @@
|
||||
[%pause-events who=ship]
|
||||
[%snap-ships lab=term hers=(list ship)]
|
||||
[%restore-snap lab=term]
|
||||
[%read [from=ship =path] [for=lane:ames num=@ud]]
|
||||
[%event who=ship ue=unix-event]
|
||||
==
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user