//-- execute and return result // session state connect only, to allow program to set catalog options public override Result RunScript(string program, ExecModes kind, string sourcename) { var session = RequestSession.Open(this, _catalog, SessionState.Connect); Logger.WriteLine(2, ">RunScript <{0}> len={1} kind={2}", program.Shorten(20), program.Length, kind); var result = (kind == ExecModes.Raw) ? session.RunScriptRaw(program, sourcename) : session.RunScriptJson(program, sourcename); session.Close(); return(result); }
//--- a gateway for submitting and executing program fragments // Compile and execute the program, returning error or program output or object // Result.Ok false means bad request, could not execute, message says why // Result.Ok true means request executed, value is return. // In raw mode input and output both raw text // In Json mode, input is Json string and output is Json object public abstract Result RunScript(string program, ExecModes kind = ExecModes.Raw, string sourcname = "");