/// <summary> /// Processes worker process requests. /// </summary> public static WorkerProcessResponse ProcessRequest(WorkerProcessRequest request) { var engine = new ScriptEngine(); var response = new WorkerProcessResponse(); try { // Execute the provided script. object result = engine.Evaluate(request.Script); response.JsonResult = JSONObject.Stringify(engine, result); } catch (Exception e) { // There was an error. response.ErrorType = e.GetType().Name; response.ErrorMessage = e.Message; } return response; }
/// <summary> /// Processes worker process requests. /// </summary> public static WorkerProcessResponse ProcessRequest(WorkerProcessRequest request) { var engine = new ScriptEngine(); var response = new WorkerProcessResponse(); try { // Execute the provided script. object result = engine.Evaluate(request.Script); response.JsonResult = JSONObject.Stringify(engine, result); } catch (Exception e) { // There was an error. response.ErrorType = e.GetType().Name; response.ErrorMessage = e.Message; } return(response); }