Add HTML examples.
Merge branch 'main' of https://github.com/hdijkema/web-racket # Conflicts: # private/webui-wire-download.rkt Signed-off-by: Hans Dijkema <hans@dijkewijk.nl>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
(require "webui-wire-download.rkt"
|
||||
racket/string
|
||||
racket/system
|
||||
)
|
||||
|
||||
(provide webui-ipc)
|
||||
@@ -61,28 +62,32 @@
|
||||
)
|
||||
|
||||
(define (webui-ipc event-queuer log-processor)
|
||||
(let* ((webui-wire-exe (ww-webui-wire))
|
||||
(proc-args (append (list #f #f #f) webui-wire-exe))
|
||||
)
|
||||
(let ((webui-wire-cmd (ww-get-webui-wire-command)))
|
||||
(call-with-values
|
||||
(λ () (apply subprocess proc-args))
|
||||
(λ (pid process-stdout process-stdin process-stderr)
|
||||
(let ((reader-thrd (process-stderr-reader process-stderr event-queuer log-processor)))
|
||||
(λ (cmd)
|
||||
(displayln cmd process-stdin)
|
||||
(flush-output process-stdin)
|
||||
(let* ((str-length (read-string 8 process-stdout))
|
||||
(colon (read-string 1 process-stdout)))
|
||||
;(displayln (format "len: ~a, str-length: ~a, colon: ~a" (string-length str-length) str-length colon))
|
||||
(unless (and (string? colon)
|
||||
(λ () (process webui-wire-cmd))
|
||||
(λ (args)
|
||||
(let ((process-stdout (car args))
|
||||
(process-stdin (cadr args))
|
||||
(pid (caddr args))
|
||||
(process-stderr (cadddr args))
|
||||
(signal-func (car (cddddr args)))
|
||||
)
|
||||
(let ((reader-thrd (process-stderr-reader process-stderr event-queuer log-processor)))
|
||||
(λ (cmd)
|
||||
(displayln cmd process-stdin)
|
||||
(flush-output process-stdin)
|
||||
(let* ((str-length (read-string 8 process-stdout))
|
||||
(colon (read-string 1 process-stdout)))
|
||||
;(displayln (format "len: ~a, str-length: ~a, colon: ~a" (string-length str-length) str-length colon))
|
||||
(unless (and (string? colon)
|
||||
(string=? colon ":"))
|
||||
(error "Unexpected input from webui-wire executable"))
|
||||
(let* ((length (string->number str-length))
|
||||
(input (read-string length process-stdout))
|
||||
)
|
||||
(error "Unexpected input from webui-wire executable"))
|
||||
(let* ((length (string->number str-length))
|
||||
(input (read-string length process-stdout))
|
||||
)
|
||||
(read-eol process-stdout)
|
||||
input)))))
|
||||
))
|
||||
input)))))
|
||||
)))
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user