If it does come in as such, assume you can use read0 on it then maybe something like this might work (I don’t know what format the time is in…):
q)quote:([] sym:$();buy:float$(); sell:float$(); time:long$());q)quote insert "SFFJ"$ssr[;"[\"\" }';]";""] each last each ":" vs/: "," vs first read0 httpRequest,0q)quotesym buy sell time---------------------------------EUR/USD 1.123 1.122 1440365747319
I believe keeping the connection open in .z.ph would hold up the rest of the process since kdb+ is single-threaded by default so it might be simplest to handle the long-lived connection from a separate process.
You can test this by starting up a Q process with an open port, running \sleep 100 (or some sufficiently long interval) and attempting to access it through HTTP or sending a message to it from another process. Either method should hang while Q is executing the sleep command.
I believe keeping the connection open in .z.ph would hold up the rest of the process since kdb+ is single-threaded by default so it might be simplest to handle the long-lived connection from a separate process.
You can test this by starting up a Q process with an open port, running\sleep 100 (or some sufficiently long interval) and attempting to access it through HTTP or sending a message to it from another process. Either method should hang while Q is executing the sleep command.
(Apologies in advance if this shows up as a double-post.)
write something that consumes the stream and prints the payload to stdout. “wget -O -” may work. i havent your http streaming server to test it here. below please find the code that streams payload to stdout.