From 323d184a247cfdd9b436c0d06fa874d85fef34a8 Mon Sep 17 00:00:00 2001 From: Immortalin Date: Mon, 23 Nov 2015 10:22:36 +0800 Subject: [PATCH] Added console.log warning --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 76f0d7a..2955970 100644 --- a/README.md +++ b/README.md @@ -169,3 +169,12 @@ node server. var log = require("node_erlastic").log; log("your log"); ``` +### Warning + + Do not ever use `console.log` because the erlang code reads stdout and will give timeout errors: + ```erlang + res = receive do {^port,{:data,b}}->:erlang.binary_to_term(b) end + ``` + In Javascript, the stdout call is buffered, see this: + https://stackoverflow.com/questions/12510835/stdout-flush-for-nodejs +