Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stub new HTTP cache hostcalls (witx only) #433

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion lib/compute-at-edge-abi/compute-at-edge.witx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(use "typenames.witx")
(use "cache.witx")
(use "config-store.witx")
(use "http-cache.witx")

(module $fastly_abi
(@interface func (export "init")
Expand Down Expand Up @@ -396,6 +397,26 @@
(error $fastly_status)))
)

;; Like `send_v2`, but does NOT provide caching of any form, and does not set `X-Cache` or
;; similar.
;;
;; This hostcall is intended to ultimately replace `send_v2` as HTTP caching becomes managed
;; explicitly at the SDK level.
;;
;; Any cache override setting on the request is ignored.
;;
;; Making this a distinct hostcall, rather than a cache override variant, may make it easier
;; to tell when support for old styles of send can be safely dropped.
(@interface func (export "send_v3")
(param $h $request_handle)
(param $b $body_handle)
(param $backend string)
(param $error_detail (@witx pointer $send_error_detail))
(result $err (expected
(tuple $response_handle $body_handle)
(error $fastly_status)))
)

(@interface func (export "send_async")
(param $h $request_handle)
(param $b $body_handle)
Expand All @@ -404,6 +425,27 @@
(error $fastly_status)))
)

;; Like `send_async`, but does NOT provide caching of any form, and does not set `X-Cache` or
;; similar.
;;
;; Also encompasses `send_async_streaming` by including a streaming flag.
;;
;; This hostcall is intended to ultimately replace `send_async{_streaming}` as HTTP
;; caching becomes managed explicitly at the SDK level.
;;
;; Any cache override setting on the request is ignored.
;;
;; Making this a distinct hostcall, rather than a cache override variant, may make it easier
;; to tell when support for old styles of send can be safely dropped.
(@interface func (export "send_async_v2")
(param $h $request_handle)
(param $b $body_handle)
(param $backend string)
(param $streaming u32)
(result $err (expected $pending_request_handle
(error $fastly_status)))
)

(@interface func (export "send_async_streaming")
(param $h $request_handle)
(param $b $body_handle)
Expand Down Expand Up @@ -787,7 +829,7 @@
(param $body_handle_out (@witx pointer $body_handle))
(result $err (expected (error $fastly_status)))
)

(@interface func (export "insert")
(param $store $object_store_handle)
(param $key string)
Expand Down
Loading
Loading