public ActionResult PollAll(string type, string key) { if (type.IsNullOrEmpty() || key.IsNullOrEmpty()) { return(ContentNotFound()); } PollingEngine.Poll(type, key); return(Json(new { success = true })); }
public ActionResult Poll(string type, string key, Guid?id) { if (!type.HasValue() || !key.HasValue()) { return(ContentNotFound()); } var success = PollingEngine.Poll(type, key, id); return(Json(new { success })); }
public ActionResult Poll(Guid?id) { if (!id.HasValue) { return(ContentNotFound()); } var success = PollingEngine.Poll(id.Value); return(Json(new { success })); }
public ActionResult JsonNodes(string type, string uniqueKey, Guid?guid = null) { if (type.IsNullOrEmpty()) { return(JsonError("type is missing")); } if (uniqueKey.IsNullOrEmpty()) { return(JsonError("uniqueKey is missing")); } try { var pollResult = PollingEngine.Poll(type, uniqueKey, guid, sync: true); return(Json(pollResult)); } catch (Exception e) { return(JsonError("Error polling node: " + e.Message)); } }