diff --git a/src/babashka/pods/impl.clj b/src/babashka/pods/impl.clj index 52146b8..eded61e 100644 --- a/src/babashka/pods/impl.clj +++ b/src/babashka/pods/impl.clj @@ -219,9 +219,12 @@ ;; listening to output synchronous. (when out (binding [*out* out-stream] - (println out))) - (when err (binding [*out* err-stream] - (println err))) + (print out) + (.flush ^java.io.Writer out-stream))) + (when err + (binding [*out* err-stream] + (print err) + (.flush ^java.io.Writer err-stream))) (when (or value* error? namespace) (cond promise? (deliver chan (cond error? exception @@ -292,7 +295,8 @@ the socket is connected." ^Socket [^String hostname ^Integer port] - (Socket. hostname port)) + (doto (Socket. hostname port) + (.setTcpNoDelay true))) (defn close-socket "Close the socket, and also closes its input and output streams." diff --git a/test-pod/pod/test_pod.clj b/test-pod/pod/test_pod.clj index 8e483b5..7fb8506 100644 --- a/test-pod/pod/test_pod.clj +++ b/test-pod/pod/test_pod.clj @@ -207,14 +207,14 @@ "id" id}) pod.test-pod/print (do (write out - {"out" (pr-str args) + {"out" (with-out-str (prn args)) "id" id}) (write out {"status" ["done"] "id" id})) pod.test-pod/print-err (do (write out - {"err" (pr-str args) + {"err" (with-out-str (prn args)) "id" id}) (write out {"status" ["done"]