Skip to content

Instantly share code, notes, and snippets.

@shirok
Created January 28, 2016 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shirok/7012bbe3430d025bd6e4 to your computer and use it in GitHub Desktop.
Save shirok/7012bbe3430d025bd6e4 to your computer and use it in GitHub Desktop.
(use gauche.process)
(use rfc.http)
(define (spawn-and-talk-to-server)
(let* ([p (run-process '("gosh" "./server-script.scm") :wait #f :output :pipe)]
[s (read-line (process-output p))])
(unwind-protect
(and (string? s) (#/^\d+$/ s)
(http-get #"localhost:~s" "/"))
(process-kill p)
(process-wait p))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment