adds %rver route-bindings to tapp/stdio

This commit is contained in:
Joe Bryan 2019-06-25 22:35:46 -07:00
parent e3713148a1
commit 12d4b28613
3 changed files with 38 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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]
==
::