mirror of
https://github.com/urbit/shrub.git
synced 2025-01-05 19:46:50 +03:00
adds %rver route-bindings to tapp/stdio
This commit is contained in:
parent
e3713148a1
commit
12d4b28613
@ -195,6 +195,35 @@
|
|||||||
::
|
::
|
||||||
:: ----
|
:: ----
|
||||||
::
|
::
|
||||||
|
:: Incoming HTTP requests
|
||||||
|
::
|
||||||
|
++ bind-route-raw
|
||||||
|
|= [=binding:http-server =term]
|
||||||
|
=/ m (async ,~)
|
||||||
|
^- form:m
|
||||||
|
(send-raw-card [%connect / binding term])
|
||||||
|
::
|
||||||
|
++ take-bound
|
||||||
|
=/ m (async ?)
|
||||||
|
^- form:m
|
||||||
|
|= =async-input
|
||||||
|
:^ ~ ~ ~
|
||||||
|
?~ in.async-input
|
||||||
|
[%wait ~]
|
||||||
|
=* sign sign.u.in.async-input
|
||||||
|
?. ?=(%bound -.sign)
|
||||||
|
[%fail %expected-bound >got=-.sign< ~]
|
||||||
|
[%done success.sign]
|
||||||
|
::
|
||||||
|
++ bind-route
|
||||||
|
|= [=binding:http-server =term]
|
||||||
|
=/ m (async ?)
|
||||||
|
^- form:m
|
||||||
|
;< ~ bind:m (bind-route-raw binding term)
|
||||||
|
take-bound
|
||||||
|
::
|
||||||
|
:: ----
|
||||||
|
::
|
||||||
:: Identity is immutable
|
:: Identity is immutable
|
||||||
::
|
::
|
||||||
:: XX should be statefully cycled
|
:: XX should be statefully cycled
|
||||||
|
@ -403,6 +403,13 @@
|
|||||||
`this-tapp
|
`this-tapp
|
||||||
start-async
|
start-async
|
||||||
::
|
::
|
||||||
|
:: Receive route binding notification
|
||||||
|
::
|
||||||
|
++ bound
|
||||||
|
|= [=wire success=? =binding:http-server]
|
||||||
|
^- (quip move _this-tapp)
|
||||||
|
(take-async bowl `[wire %bound success binding])
|
||||||
|
::
|
||||||
:: Continue computing async
|
:: Continue computing async
|
||||||
::
|
::
|
||||||
++ take-async
|
++ take-async
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
[%diff out-peer-data]
|
[%diff out-peer-data]
|
||||||
[%request wire request:http outbound-config:http-client]
|
[%request wire request:http outbound-config:http-client]
|
||||||
[%cancel-request wire ~]
|
[%cancel-request wire ~]
|
||||||
|
[%connect wire binding:http-server term]
|
||||||
[%http-response =http-event:http]
|
[%http-response =http-event:http]
|
||||||
[%rule wire %turf %put turf]
|
[%rule wire %turf %put turf]
|
||||||
==
|
==
|
||||||
@ -23,6 +24,7 @@
|
|||||||
[%coup =dock error=(unit tang)]
|
[%coup =dock error=(unit tang)]
|
||||||
[%quit =dock =path]
|
[%quit =dock =path]
|
||||||
[%reap =dock =path error=(unit tang)]
|
[%reap =dock =path error=(unit tang)]
|
||||||
|
[%bound success=? =binding:http-server]
|
||||||
[%http-response response=client-response:http-client]
|
[%http-response response=client-response:http-client]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
|
Loading…
Reference in New Issue
Block a user