Add an example slow endpoint to help with testing
How other things handle slow responses.
This commit is contained in:
parent
eec7715928
commit
b781d0e86d
1 changed files with 15 additions and 0 deletions
|
|
@ -874,6 +874,21 @@
|
||||||
(('GET "compare-by-datetime" _ ...) (delegate-to compare-controller))
|
(('GET "compare-by-datetime" _ ...) (delegate-to compare-controller))
|
||||||
(('GET "jobs" _ ...) (delegate-to jobs-controller))
|
(('GET "jobs" _ ...) (delegate-to jobs-controller))
|
||||||
(('GET "job" job-id) (delegate-to jobs-controller))
|
(('GET "job" job-id) (delegate-to jobs-controller))
|
||||||
|
;; Example slow endpoint to help with testing
|
||||||
|
(('GET "slow")
|
||||||
|
(list (build-response
|
||||||
|
#:code 200
|
||||||
|
#:headers '((content-type . (text/plain
|
||||||
|
(charset . "utf-8")))
|
||||||
|
(vary . (accept))))
|
||||||
|
(lambda (port)
|
||||||
|
(force-output port)
|
||||||
|
(for-each
|
||||||
|
(lambda (i)
|
||||||
|
(put-string port (simple-format #f "slow ~A\n" i))
|
||||||
|
(force-output port)
|
||||||
|
(sleep 5))
|
||||||
|
(iota 12)))))
|
||||||
(('GET _ ...) (delegate-to nar-controller))
|
(('GET _ ...) (delegate-to nar-controller))
|
||||||
((method path ...)
|
((method path ...)
|
||||||
(render-html
|
(render-html
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue