Rserve now supports direct input through the oob message "console.in". However, rserve.js disables named oob messages when in ocap_mode.
This PR is an attempt to fix that. I still want to test it further, but I thought I would open the PR now to make sure I am not breaking the design of rserve.js somehow.
+@s-u
Details below from commit message:
instead of switching on opts.ocap_mode, switch on the type of the wrapped
payload's first element:
if it's a string, check if on_oob_message supplied. if so, call it
with the usual function(error, result) callback.
NOTE: the signature was the opposite before, function(message, error),
so this is a breaking change! but (error, result) is the standard
asynchronous javascript signature, so i think this is correct.
if it's a function, make sure we are in ocap mode. if so, call the function
exactly as before.
if it's anything else, report "Unknown oob message type".
Rserve now supports direct input through the oob message "console.in". However, rserve.js disables named oob messages when in
ocap_mode
.This PR is an attempt to fix that. I still want to test it further, but I thought I would open the PR now to make sure I am not breaking the design of rserve.js somehow.
+@s-u
Details below from commit message:
instead of switching on opts.ocap_mode, switch on the type of the wrapped payload's first element:
NOTE: the signature was the opposite before, function(message, error), so this is a breaking change! but (error, result) is the standard asynchronous javascript signature, so i think this is correct.