2023-04-12 17:50:29 +03:00
|
|
|
:: %lick
|
|
|
|
!:
|
|
|
|
!? 164
|
|
|
|
::
|
|
|
|
=, lick
|
|
|
|
|= our=ship
|
|
|
|
=> |%
|
|
|
|
+$ move [p=duct q=(wite note gift)]
|
2023-04-20 19:25:57 +03:00
|
|
|
+$ note ~ :: out request $->
|
2023-04-12 17:50:29 +03:00
|
|
|
+$ sign ~
|
|
|
|
::
|
|
|
|
+$ lick-state
|
|
|
|
$: %0
|
2023-09-05 16:17:06 +03:00
|
|
|
unix-duct=_`duct`[//lick ~]
|
2023-05-04 17:06:02 +03:00
|
|
|
owners=(map name duct)
|
2023-04-12 17:50:29 +03:00
|
|
|
==
|
|
|
|
::
|
2023-04-27 22:29:54 +03:00
|
|
|
+$ name path
|
2023-04-12 17:50:29 +03:00
|
|
|
--
|
|
|
|
::
|
|
|
|
~% %lick ..part ~
|
|
|
|
::
|
|
|
|
=| lick-state
|
|
|
|
=* state -
|
|
|
|
|= [now=@da eny=@uvJ rof=roof]
|
|
|
|
=* lick-gate .
|
|
|
|
^?
|
|
|
|
|%
|
|
|
|
:: +register: Create a move to register an agent with vere
|
|
|
|
::
|
|
|
|
++ register
|
2023-04-20 19:25:57 +03:00
|
|
|
|= =name
|
2023-04-12 17:50:29 +03:00
|
|
|
^- move
|
2023-04-20 19:25:57 +03:00
|
|
|
[unix-duct.state %give [%spin name]]
|
2023-04-27 16:14:54 +03:00
|
|
|
:: +disconnect: Create Move to send a disconnect soak to am agent
|
|
|
|
::
|
|
|
|
++ disconnect
|
|
|
|
|= =name
|
|
|
|
^- move
|
2023-05-04 17:06:02 +03:00
|
|
|
=/ =duct (~(get by owners) name)
|
2023-04-27 16:14:54 +03:00
|
|
|
[+.duct %give [%soak name %disconnect ~]]
|
2023-04-12 17:50:29 +03:00
|
|
|
:: +call: handle a +task:lick request
|
|
|
|
::
|
|
|
|
++ call
|
|
|
|
|= $: hen=duct
|
|
|
|
dud=(unit goof)
|
|
|
|
wrapped-task=(hobo task)
|
|
|
|
==
|
|
|
|
^- [(list move) _lick-gate]
|
|
|
|
::
|
|
|
|
=/ =task ((harden task) wrapped-task)
|
|
|
|
?+ -.task [~ lick-gate]
|
2023-04-27 16:14:54 +03:00
|
|
|
%born :: need to register devices with vere and send disconnect soak
|
|
|
|
:- %+ weld
|
2023-05-04 17:06:02 +03:00
|
|
|
(turn ~(tap in ~(key by owners.state)) register)
|
|
|
|
(turn ~(tap in ~(key by owners.state)) disconnect)
|
2023-04-20 19:25:57 +03:00
|
|
|
lick-gate(unix-duct hen)
|
|
|
|
::
|
|
|
|
%spin :: A gall agent wants to spin a communication line
|
|
|
|
:- ~[(register name.task)]
|
2023-05-04 17:06:02 +03:00
|
|
|
lick-gate(owners (~(put by owners) name.task hen))
|
2023-04-20 19:25:57 +03:00
|
|
|
::
|
|
|
|
%shut :: shut down a communication line
|
2023-05-04 17:06:02 +03:00
|
|
|
:- [unix-duct.state %give [%shut name.task]]~
|
|
|
|
lick-gate(owners (~(del by owners) name.task))
|
2023-04-20 19:25:57 +03:00
|
|
|
::
|
|
|
|
%soak :: push a soak to the ipc's owner
|
2023-05-04 17:06:02 +03:00
|
|
|
=/ ner=duct (~(get by owners.state) name.task)
|
2023-04-20 19:25:57 +03:00
|
|
|
:_ lick-gate
|
2023-05-04 17:06:02 +03:00
|
|
|
[+.ner %give [%soak name.task mark.task noun.task]]~
|
2023-04-12 17:50:29 +03:00
|
|
|
::
|
2023-04-20 19:25:57 +03:00
|
|
|
%spit :: push a spit to ipc
|
|
|
|
:_ lick-gate
|
2023-05-04 17:06:02 +03:00
|
|
|
[unix-duct.state %give [%spit name.task mark.task noun.task]]~
|
2023-04-12 17:50:29 +03:00
|
|
|
==
|
|
|
|
:: +load: migrate an old state to a new lick version
|
|
|
|
::
|
|
|
|
++ load
|
|
|
|
|= old=lick-state
|
|
|
|
^+ lick-gate
|
|
|
|
lick-gate(state old)
|
|
|
|
:: +scry: view state
|
|
|
|
::
|
2023-05-04 17:06:02 +03:00
|
|
|
:: %a scry out a list of all ipc ports
|
|
|
|
:: %d get the owner of an ipc port
|
2023-04-12 17:50:29 +03:00
|
|
|
++ scry
|
|
|
|
^- roon
|
2023-06-22 19:25:40 +03:00
|
|
|
|= [lyc=gang pov=path car=term bem=beam]
|
2023-04-12 17:50:29 +03:00
|
|
|
^- (unit (unit cage))
|
2023-05-04 17:07:11 +03:00
|
|
|
|^
|
2023-05-04 17:06:02 +03:00
|
|
|
:: only respond for the local identity, current timestamp
|
|
|
|
::
|
2023-06-16 16:58:05 +03:00
|
|
|
?. ?& =(our p.bem)
|
|
|
|
=(%$ q.bem)
|
|
|
|
=([%da now] r.bem)
|
2023-05-04 17:06:02 +03:00
|
|
|
==
|
|
|
|
~
|
|
|
|
?+ car ~
|
2023-06-16 16:58:05 +03:00
|
|
|
%a read-a
|
|
|
|
%d read-d
|
|
|
|
%u read-u
|
2023-05-04 17:06:02 +03:00
|
|
|
==
|
2023-06-16 16:58:05 +03:00
|
|
|
:: +read-a: scry our list of ports
|
2023-05-04 17:06:02 +03:00
|
|
|
::
|
|
|
|
++ read-a
|
|
|
|
^- (unit (unit cage))
|
2023-06-16 16:58:05 +03:00
|
|
|
=/ ports=(list name) ~(tap in ~(key by owners))
|
2023-05-04 17:06:02 +03:00
|
|
|
``[%noun !>(ports)]
|
|
|
|
:: +read d: get ports owner
|
|
|
|
::
|
|
|
|
++ read-d
|
|
|
|
^- (unit (unit cage))
|
2023-06-16 16:58:05 +03:00
|
|
|
=/ devs=(unit duct) (~(get by owners) s.bem)
|
|
|
|
?~ devs [~ ~]
|
2023-05-04 17:06:02 +03:00
|
|
|
``[%noun !>(devs)]
|
2023-06-16 16:58:05 +03:00
|
|
|
:: +read u: does a port exist
|
|
|
|
::
|
|
|
|
++ read-u
|
|
|
|
^- (unit (unit cage))
|
2023-06-16 19:02:32 +03:00
|
|
|
``[%noun !>((~(has by owners) s.bem))]
|
2023-06-16 16:58:05 +03:00
|
|
|
::
|
2023-05-04 17:06:02 +03:00
|
|
|
--
|
2023-04-12 17:50:29 +03:00
|
|
|
::
|
|
|
|
++ stay
|
|
|
|
state
|
|
|
|
++ take
|
|
|
|
|= [tea=wire hen=duct dud=(unit goof) hin=sign]
|
|
|
|
^- [(list move) _lick-gate]
|
|
|
|
?^ dud
|
|
|
|
~|(%lick-take-dud (mean tang.u.dud))
|
|
|
|
::
|
|
|
|
[~ lick-gate]
|
|
|
|
--
|