mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 10:02:47 +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
|
||||
::
|
||||
:: XX should be statefully cycled
|
||||
|
@ -403,6 +403,13 @@
|
||||
`this-tapp
|
||||
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
|
||||
::
|
||||
++ take-async
|
||||
|
@ -12,6 +12,7 @@
|
||||
[%diff out-peer-data]
|
||||
[%request wire request:http outbound-config:http-client]
|
||||
[%cancel-request wire ~]
|
||||
[%connect wire binding:http-server term]
|
||||
[%http-response =http-event:http]
|
||||
[%rule wire %turf %put turf]
|
||||
==
|
||||
@ -23,6 +24,7 @@
|
||||
[%coup =dock error=(unit tang)]
|
||||
[%quit =dock =path]
|
||||
[%reap =dock =path error=(unit tang)]
|
||||
[%bound success=? =binding:http-server]
|
||||
[%http-response response=client-response:http-client]
|
||||
==
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user