예제 #1
0
        public ActionResult PollAll(string type, string key)
        {
            if (type.IsNullOrEmpty() || key.IsNullOrEmpty())
            {
                return(ContentNotFound());
            }

            PollingEngine.Poll(type, key);

            return(Json(new { success = true }));
        }
예제 #2
0
        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 }));
        }
예제 #3
0
        public ActionResult Poll(Guid?id)
        {
            if (!id.HasValue)
            {
                return(ContentNotFound());
            }

            var success = PollingEngine.Poll(id.Value);

            return(Json(new { success }));
        }
예제 #4
0
 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));
     }
 }