mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-29 09:53:13 +03:00
mall: convert hall to mall
This commit is contained in:
parent
fc9f17ae23
commit
30f74368fb
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:393705422a0c117f1adb64c4606021d50f2520152dd5b34691cf8a386e0dfec6
|
||||
size 15813426
|
||||
oid sha256:ed76a74e19d04666431b99f8cfc74d370f48e726ecf1aa82f4da7a4f1b97846a
|
||||
size 16241615
|
||||
|
3437
pkg/arvo/age/hall.hoon
Normal file
3437
pkg/arvo/age/hall.hoon
Normal file
File diff suppressed because it is too large
Load Diff
@ -100,7 +100,7 @@
|
||||
++ ably :: save part
|
||||
=+ $:{(list) hood-part}
|
||||
|@ ++ $
|
||||
[+<- (~(put by lac) +<+< +<+)]
|
||||
[(flop +<-) (~(put by lac) +<+< +<+)]
|
||||
--
|
||||
:: :: ::
|
||||
:::: :: :: generic handling
|
||||
|
@ -114,10 +114,7 @@
|
||||
==
|
||||
--
|
||||
::
|
||||
:: #
|
||||
:: # %work
|
||||
:: #
|
||||
:: functional cores and arms.
|
||||
:: Formal agent
|
||||
::
|
||||
=; talk-core
|
||||
=| stat=[%1 state]
|
||||
@ -153,9 +150,9 @@
|
||||
::
|
||||
++ handle-subscribe
|
||||
|= =path
|
||||
|
||||
^- step:agent:mall
|
||||
=^ cards=(list card:agent:mall) talk-core (~(peer talk-core bowl stat) path)
|
||||
=^ cards=(list card:agent:mall) talk-core
|
||||
(~(peer talk-core bowl stat) path)
|
||||
[cards this(stat +<+.talk-core)]
|
||||
::
|
||||
++ handle-unsubscribe ~(handle-unsubscribe default-agent bowl this)
|
||||
@ -187,6 +184,12 @@
|
||||
++ handle-arvo-response ~(handle-arvo-response default-agent bowl this)
|
||||
++ handle-error ~(handle-error default-agent bowl this)
|
||||
--
|
||||
::
|
||||
:: #
|
||||
:: # %work
|
||||
:: #
|
||||
:: functional cores and arms.
|
||||
::
|
||||
|_ {bol/bowl:mall $1 state}
|
||||
::
|
||||
:: # %transition
|
||||
|
@ -5,7 +5,7 @@
|
||||
::
|
||||
::::
|
||||
::
|
||||
|_ bol/bowl:gall
|
||||
|_ bol/bowl:mall
|
||||
::
|
||||
::TODO add to zuse?
|
||||
++ true-self
|
||||
@ -20,12 +20,13 @@
|
||||
::
|
||||
++ said-url :: app url
|
||||
|= url/purl:eyre
|
||||
:^ ost.bol %poke /said-url
|
||||
:+ [our.bol %hall] %hall-action
|
||||
^- action
|
||||
:+ %phrase
|
||||
[[our.bol %inbox] ~ ~]
|
||||
[%app dap.bol %lin | (crip (en-purl:html url))]~ :: XX
|
||||
:* %pass /said-url %agent [our.bol %hall]
|
||||
%poke %hall-action !>
|
||||
^- action
|
||||
:+ %phrase
|
||||
[[our.bol %inbox] ~ ~]
|
||||
[%app dap.bol %lin | (crip (en-purl:html url))]~ :: XX
|
||||
==
|
||||
::
|
||||
++ said :: app message
|
||||
|= mes/(list tank)
|
||||
|
@ -26,11 +26,11 @@
|
||||
+| %query-models
|
||||
::
|
||||
++ query :: query paths
|
||||
$% {$client ~} :: shared ui state
|
||||
$% {$client ~} :: shared ui state
|
||||
{$circles who/ship} :: readable circles
|
||||
{$public ~} :: public memberships
|
||||
{$public ~} :: public memberships
|
||||
{$burden who/ship} ::TODO eventually, nom/name. :: duties to share
|
||||
{$report ~} :: duty reports
|
||||
{$report ~} :: duty reports
|
||||
{$peers nom/name} :: readers of story
|
||||
$: $circle :: story query
|
||||
nom/name :: circle name
|
||||
@ -63,7 +63,7 @@
|
||||
{$circles cis/(set name)} :: /circles
|
||||
{$public cis/(set circle)} :: /public
|
||||
{$burden sos/(map name burden)} :: /burden
|
||||
{$report ~} :: /report
|
||||
{$report ~} :: /report
|
||||
{$peers pes/(jar ship query)} :: /peers
|
||||
{$circle package} :: /circle
|
||||
== ::
|
||||
@ -103,7 +103,7 @@
|
||||
{$peer add/? who/ship qer/query} :: gain/lose subscriber
|
||||
{$config cir/circle dif/diff-config} :: new/changed config
|
||||
{$status cir/circle who/ship dif/diff-status} :: new/changed status
|
||||
{$remove ~} :: removed story
|
||||
{$remove ~} :: removed story
|
||||
== ::
|
||||
++ rumor-story :: story rumor
|
||||
$% {$gram src/circle nev/envelope} :: new/changed message
|
||||
@ -172,7 +172,7 @@
|
||||
++ command :: effect on story
|
||||
$% {$publish tos/(list thought)} :: deliver
|
||||
{$present nos/(set name) dif/diff-status} :: status update
|
||||
{$bearing ~} :: prompt to listen
|
||||
{$bearing ~} :: prompt to listen
|
||||
== ::
|
||||
::
|
||||
:: #
|
||||
|
@ -488,7 +488,7 @@
|
||||
::
|
||||
++ hurl :: start loop
|
||||
|= {lac/? ovo/ovum}
|
||||
~? &(!lac !=(%belt -.q.ovo)) ["" %unix -.q.ovo p.ovo now]
|
||||
~? !lac ["" %unix -.q.ovo p.ovo now]
|
||||
:: ^- {p/(list ovum) q/(pair worm (list {p/@tas q/vase}))}
|
||||
^- {p/(list ovum) q=(list [label=@tas =vane])}
|
||||
?> ?=(^ p.ovo)
|
||||
@ -543,6 +543,10 @@
|
||||
~? &(!lac !=(%$ p.gum))
|
||||
:- (runt [s.gum '|'] "")
|
||||
:^ %pass [p.gum p.q.r.gum]
|
||||
?: ?=(?(%deal %deal-mall) +>-.q.q.r.gum)
|
||||
:- :- +>-.q.q.r.gum
|
||||
(,[[ship ship] term term] [+>+< +>+>- +>+>+<]:q.q.r.gum)
|
||||
p.r.gum
|
||||
[(symp +>-.q.q.r.gum) p.r.gum]
|
||||
q.gum
|
||||
[p.q.r.gum ~ [[p.gum p.r.gum] q.gum] q.q.r.gum]
|
||||
@ -554,7 +558,11 @@
|
||||
!!
|
||||
~? &(!lac |(!=(%blit +>-.p.r.gum) !=(%d p.gum)))
|
||||
:- (runt [s.gum '|'] "")
|
||||
[%give p.gum (symp +>-.p.r.gum) `duct`q.gum]
|
||||
:^ %give p.gum
|
||||
?: ?=(%unto +>-.p.r.gum)
|
||||
[+>-.p.r.gum (term +>+<.p.r.gum)]
|
||||
(symp +>-.p.r.gum)
|
||||
`duct`q.gum
|
||||
[i.i.q.gum [~ t.i.q.gum] t.q.gum p.r.gum]
|
||||
::
|
||||
$slip
|
||||
|
@ -863,7 +863,7 @@
|
||||
=/ initialised
|
||||
=/ out (mo-retrieve-duct ship bone)
|
||||
(mo-abed out)
|
||||
(mo-give:initialised %unto %subscription-close ~)
|
||||
(mo-give:initialised %unto %subscription-close ~ ~)
|
||||
==
|
||||
:: +ap: agent engine
|
||||
::
|
||||
@ -928,13 +928,15 @@
|
||||
::
|
||||
=/ internal-cards agent-cards
|
||||
=/ bad-ducts *(set duct)
|
||||
=; core
|
||||
core(agent-duct agent-duct)
|
||||
|- ^+ ap-core
|
||||
?^ internal-cards
|
||||
=/ =card:agent i.internal-cards
|
||||
?. ?=([%give %subscription-update *] card)
|
||||
$(internal-cards t.internal-cards)
|
||||
::
|
||||
=/ ducts (ap-ducts-from-path path.p.card)
|
||||
=/ ducts (ap-ducts-from-path path.p.card ~)
|
||||
|- ^+ ap-core
|
||||
?~ ducts
|
||||
^$(internal-cards t.internal-cards)
|
||||
@ -978,7 +980,7 @@
|
||||
?. ?=(%subscription-update -.gift)
|
||||
[agent-duct %give %unto gift]~
|
||||
::
|
||||
=/ ducts=(list duct) (ap-ducts-from-path path.gift)
|
||||
=/ ducts=(list duct) (ap-ducts-from-path path.gift ~)
|
||||
=/ =cage cage.gift
|
||||
%+ turn ducts
|
||||
|= =duct
|
||||
@ -1026,14 +1028,22 @@
|
||||
:: +ap-ducts-from-path: get ducts subscribed to path
|
||||
::
|
||||
++ ap-ducts-from-path
|
||||
|= target-path=(unit path)
|
||||
|= [target-path=(unit path) target-ship=(unit ship)]
|
||||
^- (list duct)
|
||||
?~ target-path
|
||||
?: &(?=(~ target-path) ?=(~ target-ship))
|
||||
~[agent-duct]
|
||||
%+ murn ~(tap by incoming.subscribers.current-agent)
|
||||
|= [=duct =ship =path]
|
||||
^- (unit ^duct)
|
||||
?: =(u.target-path path)
|
||||
?~ target-ship
|
||||
?: =(target-path `path)
|
||||
`duct
|
||||
~
|
||||
?~ target-path
|
||||
?: =(target-ship `ship)
|
||||
`duct
|
||||
~
|
||||
?: &(=(target-path `path) =(target-ship `ship))
|
||||
`duct
|
||||
~
|
||||
:: +ap-apply: apply effect.
|
||||
@ -1077,7 +1087,8 @@
|
||||
?: is-ok
|
||||
=/ =note:agent [%agent [ship -.path] %pump ~]
|
||||
(ap-pass way note)
|
||||
=. ap-core (ap-give %subscription-close ~)
|
||||
~& > %agent-update-failed
|
||||
=. ap-core (ap-specific-take path %subscription-close ~ ~)
|
||||
=/ =note:agent [%agent [ship -.path] %unsubscribe ~]
|
||||
(ap-pass way note)
|
||||
:: +ap-dequeue: drop from queue.
|
||||
@ -1262,10 +1273,10 @@
|
||||
=^ maybe-tang ap-core
|
||||
%+ ap-ingest ~ |.
|
||||
(handle-agent-response:ap-agent-core path gift)
|
||||
?: ?=(%subscription-update -.gift)
|
||||
=? ap-core ?=(%subscription-update -.gift)
|
||||
(ap-update-subscription =(~ maybe-tang) attributing.agent-routes path)
|
||||
?^ maybe-tang
|
||||
(ap-error -.gift u.maybe-tang)
|
||||
(ap-error -.gift leaf/"closing subscription" u.maybe-tang)
|
||||
ap-core
|
||||
:: +ap-install: install wrapper.
|
||||
::
|
||||
@ -1343,7 +1354,7 @@
|
||||
^+ ap-core
|
||||
::
|
||||
=> ap-load-delete
|
||||
(ap-give %subscription-close ~)
|
||||
(ap-give %subscription-close ~ ~)
|
||||
:: +ap-ingest: call agent arm
|
||||
::
|
||||
:: Handle acks here because they need to be emitted before the
|
||||
@ -1398,7 +1409,7 @@
|
||||
^- (list duct)
|
||||
?. ?=([%give %subscription-close *] card)
|
||||
~
|
||||
(ap-ducts-from-path path.p.card)
|
||||
(ap-ducts-from-path [path ship]:p.card)
|
||||
::
|
||||
=/ quit-map=bitt
|
||||
(malt (turn quits |=(=duct [duct *[ship path]])))
|
||||
|
@ -1927,7 +1927,7 @@
|
||||
+$ gift
|
||||
$% [%poke-ack p=(unit tang)]
|
||||
[%subscription-update path=(unit path) =cage]
|
||||
[%subscription-close path=(unit path)]
|
||||
[%subscription-close path=(unit path) ship=(unit ship)]
|
||||
[%subscription-ack p=(unit tang)]
|
||||
[%http-response =http-event:http]
|
||||
==
|
||||
|
Loading…
Reference in New Issue
Block a user