public static OtpErlangTuple quote(@NotNull String code) throws IOException, OtpErlangExit, OtpErlangDecodeException { final OtpNode otpNode = IntellijElixir.getLocalNode(); final OtpMbox otpMbox = otpNode.createMbox(); OtpErlangObject request = elixirString(code); return (OtpErlangTuple) GenericServer.INSTANCE.call( otpMbox, otpNode, REMOTE_NAME, IntellijElixir.REMOTE_NODE, request, TIMEOUT_IN_MILLISECONDS ); }
mbox = createMbox(); mbox.send("net_kernel", anode, getPingTuple(mbox)); final OtpErlangObject reply = mbox.receive(timeout);
private boolean netKernel(final OtpMsg m) { OtpMbox mbox = null; try { final OtpErlangTuple t = (OtpErlangTuple) m.getMsg(); final OtpErlangTuple req = (OtpErlangTuple) t.elementAt(1); // actual // request final OtpErlangPid pid = (OtpErlangPid) req.elementAt(0); // originating // pid final OtpErlangObject[] pong = new OtpErlangObject[2]; pong[0] = req.elementAt(1); // his #Ref pong[1] = new OtpErlangAtom("yes"); mbox = createMbox(); mbox.send(pid, new OtpErlangTuple(pong)); return true; } catch (final Exception e) { } finally { closeMbox(mbox); } return false; }