mirror of
https://github.com/urbit/shrub.git
synced 2024-12-13 16:03:36 +03:00
fixed tooks, unsubscription
This commit is contained in:
parent
42453bdf93
commit
dc175a3565
@ -102,7 +102,6 @@
|
|||||||
[%of p=ixor ~] :: associated view
|
[%of p=ixor ~] :: associated view
|
||||||
[%on p=span:,@uvH ~] :: dependency
|
[%on p=span:,@uvH ~] :: dependency
|
||||||
[%to p=span:hasp q=span:ship ~] :: associated poke
|
[%to p=span:hasp q=span:ship ~] :: associated poke
|
||||||
[%is p=ixor q=span:hasp r=path] :: subscription
|
|
||||||
== ::
|
== ::
|
||||||
-- ::
|
-- ::
|
||||||
|% :: models
|
|% :: models
|
||||||
@ -135,12 +134,14 @@
|
|||||||
$: him=ship :: static identity
|
$: him=ship :: static identity
|
||||||
ude=(unit ,[p=duct q=?]) :: stream, long-poll?
|
ude=(unit ,[p=duct q=?]) :: stream, long-poll?
|
||||||
era=@da :: next wake
|
era=@da :: next wake
|
||||||
eve=[p=@u q=(map ,@u even)]
|
eve=[p=@u q=(map ,@u even)] :: queued events
|
||||||
|
sud=(map ,[hasp path] duct) :: cancel data
|
||||||
|
dus=(map duct ,[hasp path]) :: subscription by duct
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ even :: client event
|
++ even :: client event
|
||||||
$% [%news p=@uv]
|
$% [%news p=@uv]
|
||||||
[%rush p=[hasp path] q=json r=duct]
|
[%rush p=[hasp path] q=json]
|
||||||
[%mean p=[hasp path] q=ares]
|
[%mean p=[hasp path] q=ares]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
@ -152,8 +153,8 @@
|
|||||||
[%away ~]
|
[%away ~]
|
||||||
[%bugs p=?(%as %to) ~]
|
[%bugs p=?(%as %to) ~]
|
||||||
[%mess p=hasp q=mark r=json]
|
[%mess p=hasp q=mark r=json]
|
||||||
[%subs p=hasp %json q=path]
|
[%subs p=?(%del %put) q=[hasp %json q=path]]
|
||||||
[%deps p=@uvH q=?(%del %put)]
|
[%deps p=?(%del %put) q=@uvH]
|
||||||
[%view p=ixor q=[~ u=@ud]]
|
[%view p=ixor q=[~ u=@ud]]
|
||||||
==
|
==
|
||||||
|
|
||||||
@ -369,15 +370,20 @@
|
|||||||
(ames-gram (slav %p p.tee) got/~ (slav %uv q.tee) |2.sih)
|
(ames-gram (slav %p p.tee) got/~ (slav %uv q.tee) |2.sih)
|
||||||
::
|
::
|
||||||
?(%rush %rust)
|
?(%rush %rust)
|
||||||
?> ?=([%is ^] tee)
|
?> ?=([%of ^] tee)
|
||||||
?. ?=(%json p.sih)
|
?. ?=(%json p.sih)
|
||||||
=- (ford-req tee our [%cast %json %done ~ -])
|
=- (ford-req tee our [%cast %json %done ~ -])
|
||||||
`cage`[p.sih (slot 3 (spec (slot 3 [typ +.sih])))]
|
`cage`[p.sih (slot 3 (spec (slot 3 [typ +.sih])))]
|
||||||
%- ~(get-rush ix p.tee (~(got by wix) p.tee))
|
(~(get-rush ix p.tee (~(got by wix) p.tee)) ((hard json) q.sih))
|
||||||
[[(pick-hasp q.tee) r.tee] ((hard json) q.sih)]
|
::
|
||||||
|
%nice ~|(tee ?>(?=($|(~ [%of ^]) tee) (nice-json)))
|
||||||
|
%mean
|
||||||
|
~| tee
|
||||||
|
?+ tee !!
|
||||||
|
~ (mean-json 500 p.sih)
|
||||||
|
[%of ^] (~(get-mean ix p.tee (~(got by wix) p.tee)) p.sih)
|
||||||
|
==
|
||||||
::
|
::
|
||||||
%nice ~|(tee ?>(?=($|(~ [%is ^]) tee) (nice-json)))
|
|
||||||
%mean ~|(tee ?>(?=($|(~ [%is ^]) tee) (mean-json 500 p.sih)))
|
|
||||||
%wake
|
%wake
|
||||||
?> ?=([%of ^] tee)
|
?> ?=([%of ^] tee)
|
||||||
=> ~(wake ix p.tee (~(got by wix) p.tee))
|
=> ~(wake ix p.tee (~(got by wix) p.tee))
|
||||||
@ -401,10 +407,9 @@
|
|||||||
=. our (need hov) :: XX
|
=. our (need hov) :: XX
|
||||||
|- ^+ ..axon
|
|- ^+ ..axon
|
||||||
?- tee
|
?- tee
|
||||||
[?(%of %on %ay) *] ~|(e/ford/lost/-.tee !!)
|
[?(%on %ay) *] ~|(e/ford/lost/-.tee !!)
|
||||||
[%is ^]
|
[%of ^]
|
||||||
%+ ~(get-rush ix p.tee (~(got by wix) p.tee))
|
%- ~(get-rush ix p.tee (~(got by wix) p.tee))
|
||||||
[(pick-hasp q.tee) r.tee]
|
|
||||||
?> ?=([%& %json ^] q.sih) :: XX others
|
?> ?=([%& %json ^] q.sih) :: XX others
|
||||||
((hard json) |3.q.sih)
|
((hard json) |3.q.sih)
|
||||||
::
|
::
|
||||||
@ -705,8 +710,7 @@
|
|||||||
%in
|
%in
|
||||||
~| expect/[%post 'application/json' /'@uv' '?PUT/DELETE']
|
~| expect/[%post 'application/json' /'@uv' '?PUT/DELETE']
|
||||||
?> ?=([%post $|(~ [~ %json])] [mef p.pok])
|
?> ?=([%post $|(~ [~ %json])] [mef p.pok])
|
||||||
:+ %deps
|
=- [%deps - (raid but %uv ~)]
|
||||||
(raid but %uv ~)
|
|
||||||
?+(quy !! [[%'DELETE' ~] ~] %del, [[%'PUT' ~] ~] %put)
|
?+(quy !! [[%'DELETE' ~] ~] %del, [[%'PUT' ~] ~] %put)
|
||||||
::
|
::
|
||||||
%is
|
%is
|
||||||
@ -718,7 +722,9 @@
|
|||||||
~|(is/stub/u.p.pok !!) :: XX marks
|
~|(is/stub/u.p.pok !!) :: XX marks
|
||||||
?: ((sane %tas) i.but)
|
?: ((sane %tas) i.but)
|
||||||
$(but [(scot %p our) but])
|
$(but [(scot %p our) but])
|
||||||
[%subs [(slav %p i.but) (slav %tas -.t.but)] u.p.pok +.t.but]
|
:+ %subs
|
||||||
|
?+(quy !! [[%'DELETE' ~] ~] %del, [[%'PUT' ~] ~] %put)
|
||||||
|
[[(slav %p i.but) (slav %tas -.t.but)] u.p.pok +.t.but]
|
||||||
::
|
::
|
||||||
%auth
|
%auth
|
||||||
:- %auth
|
:- %auth
|
||||||
@ -839,9 +845,9 @@
|
|||||||
=+ ire=(oryx-to-ixor (grab-body to-oryx))
|
=+ ire=(oryx-to-ixor (grab-body to-oryx))
|
||||||
?> (~(has by wix) ire) :: XX made redundant by oryx checking
|
?> (~(has by wix) ire) :: XX made redundant by oryx checking
|
||||||
=< [%| (nice-json)]
|
=< [%| (nice-json)]
|
||||||
?- q.hem
|
?- p.hem
|
||||||
%del done(liz (~(del ju liz) p.hem %| ire))
|
%del done(liz (~(del ju liz) q.hem %| ire))
|
||||||
%put (add-depend p.hem %| ire)
|
%put (add-depend q.hem %| ire)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
%poll
|
%poll
|
||||||
@ -866,11 +872,10 @@
|
|||||||
::
|
::
|
||||||
%subs
|
%subs
|
||||||
=+ ire=(oryx-to-ixor (grab-body to-oryx))
|
=+ ire=(oryx-to-ixor (grab-body to-oryx))
|
||||||
:- %|
|
?- p.hem
|
||||||
%+ pass-note
|
%put [%| done(..ix (~(add-subs ix ire (~(got by wix) ire)) q.hem))]
|
||||||
:: =- ~& e/show/[p.hem `whir`-] -
|
%del [%| done(..ix (~(del-subs ix ire (~(got by wix) ire)) q.hem))]
|
||||||
[%is ire (pack-hasp p.hem) q.hem]
|
==
|
||||||
[%g %show [- + ~]:p.hem him q.hem]
|
|
||||||
::
|
::
|
||||||
%view
|
%view
|
||||||
~| lost-ixor/p.hem
|
~| lost-ixor/p.hem
|
||||||
@ -1044,7 +1049,7 @@
|
|||||||
=+ orx=`@t`(rsh 3 1 (scot %p (shaf %orx eny)))
|
=+ orx=`@t`(rsh 3 1 (scot %p (shaf %orx eny)))
|
||||||
=. vew (~(put in vew) orx)
|
=. vew (~(put in vew) orx)
|
||||||
=+ ire=(oryx-to-ixor orx)
|
=+ ire=(oryx-to-ixor orx)
|
||||||
=. wix (~(put by wix) ire [him ~ now [1 ~]])
|
=. wix (~(put by wix) ire [him ~ now [1 ~] ~ ~])
|
||||||
:_ abet
|
:_ abet
|
||||||
%- jobe :~
|
%- jobe :~
|
||||||
oryx/s/orx
|
oryx/s/orx
|
||||||
@ -1090,10 +1095,26 @@
|
|||||||
=+ ven=~|(seq-low/cur=p.eve (~(got by q.eve) a))
|
=+ ven=~|(seq-low/cur=p.eve (~(got by q.eve) a))
|
||||||
abet:(give-even & a ven)
|
abet:(give-even & a ven)
|
||||||
::
|
::
|
||||||
++ get-rush
|
++ add-subs
|
||||||
|= [a=[hasp path] b=json] ^+ ..ix
|
|= [a=hasp %json b=path] ^+ ..ix
|
||||||
(get-even [%rush a (joba %json b) hen])
|
=: sud (~(put by sud) [a b] hen)
|
||||||
|
dus (~(put by dus) hen [a b])
|
||||||
|
==
|
||||||
|
abet:(pass-note of//[ire] [%g %show [- + ~]:a him b])
|
||||||
::
|
::
|
||||||
|
++ del-subs
|
||||||
|
|= [a=hasp %json b=path] ^+ ..ix
|
||||||
|
=. hen (~(got by sud) [a b])
|
||||||
|
=: sud (~(del by sud) [a b] hen)
|
||||||
|
dus (~(del by dus) hen [a b])
|
||||||
|
==
|
||||||
|
abet:(pass-note of//[ire] [%g %nuke [- + ~]:a him])
|
||||||
|
::
|
||||||
|
++ get-rush
|
||||||
|
|= a=json ^+ ..ix
|
||||||
|
(get-even [%rush (~(got by dus) hen) (joba %json a)])
|
||||||
|
::
|
||||||
|
++ get-mean |=(a=ares (get-even [%mean (~(got by dus) hen) a]))
|
||||||
++ get-even
|
++ get-even
|
||||||
|= ven=even ^+ ..ix
|
|= ven=even ^+ ..ix
|
||||||
=+ num=p.eve
|
=+ num=p.eve
|
||||||
@ -1108,15 +1129,14 @@
|
|||||||
[+(p.eve) (~(put by q.eve) p.eve a)]
|
[+(p.eve) (~(put by q.eve) p.eve a)]
|
||||||
::
|
::
|
||||||
++ pass-took
|
++ pass-took
|
||||||
|= [a=hasp b=path]
|
|= a=[p=hasp path]
|
||||||
:: ~& e/took/[a `whir`[%is ire (pack-hasp a) b]]
|
=. hen (~(got by sud) a)
|
||||||
(pass-note [%is ire (pack-hasp a) b] [%g %took [- + ~]:a him])
|
(pass-note of//[ire] [%g %took [- + ~]:p.a him])
|
||||||
::
|
::
|
||||||
++ give-even
|
++ give-even
|
||||||
|= [pol=? num=@u ven=even] ^+ done
|
|= [pol=? num=@u ven=even] ^+ done
|
||||||
=: q.eve (~(del by q.eve) (dec num)) :: TODO ponder a-2
|
=: q.eve (~(del by q.eve) (dec num)) :: TODO ponder a-2
|
||||||
mow ?. ?=(%rush -.ven) mow
|
mow ?.(?=(%rush -.ven) mow mow:(pass-took p.ven))
|
||||||
mow:(pass-took(hen r.ven) p.ven)
|
|
||||||
==
|
==
|
||||||
?> pol :: XX eventstream
|
?> pol :: XX eventstream
|
||||||
%^ give-json 200 ~
|
%^ give-json 200 ~
|
||||||
|
@ -9848,7 +9848,6 @@
|
|||||||
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
:::::: :::::: Postface ::::::
|
:::::: :::::: Postface ::::::
|
||||||
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
!:
|
|
||||||
~& %post-start
|
~& %post-start
|
||||||
=+ pit=`vase`!>(.) ::
|
=+ pit=`vase`!>(.) ::
|
||||||
=+ bud=pit :: becomes tang
|
=+ bud=pit :: becomes tang
|
||||||
|
@ -101,13 +101,14 @@ window.urb.poll = function(params) {
|
|||||||
case "news":
|
case "news":
|
||||||
return document.location.reload() // XX check autoreload
|
return document.location.reload() // XX check autoreload
|
||||||
case "rush":
|
case "rush":
|
||||||
|
case "mean":
|
||||||
var fn = $this.gsig(res.data.from)
|
var fn = $this.gsig(res.data.from)
|
||||||
if($this.cabs[fn])
|
if($this.cabs[fn])
|
||||||
$this.cabs[fn].call(this,err,
|
$this.cabs[fn].call(this,err,
|
||||||
{status: res.status, data: res.data.data.json}) // XX non-json
|
{status: res.status, data: res.data.data.json}) // XX non-json
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error("Lost event %"+res.type)
|
throw new Error("Lost event %"+res.data.type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +240,6 @@ window.urb.unsubscribe = function(params,cb) {
|
|||||||
|
|
||||||
url = "/~/is/"+this.gsig(params)+"/"
|
url = "/~/is/"+this.gsig(params)+"/"
|
||||||
method = "delete"
|
method = "delete"
|
||||||
throw "XX weird loop"
|
|
||||||
this.req("delete",url,params,true,function(err,res) {
|
this.req("delete",url,params,true,function(err,res) {
|
||||||
cb(err,res)
|
cb(err,res)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user