예제 #1
0
        public static string  submit_Via_REST(this API_Firebase firebase, API_Firebase.SubmitData submitData)
        {
            var result = "";

            if (submitData.notNull())
            {
                try
                {
                    switch (submitData.Type)
                    {
                    case API_Firebase.Submit_Type.GET:
                        result = firebase.GET();
                        break;

                    case API_Firebase.Submit_Type.ADD:
                        result = firebase.POST(submitData.Data);
                        break;

                    case API_Firebase.Submit_Type.SET:
                        result = firebase.PUT(submitData.Data);
                        break;
                    }
                }
                catch (Exception ex)
                {
                    ex.log("[API_Firebase] [submit_Via_REST] for: {0}".format(submitData));
                }
                if (result.notValid())                          // this could happen in the cases where the SSL failed to connect
                {
                    firebase.offlineQueue().add(submitData);
                }
            }
            return(result);
        }
예제 #2
0
 public static BlockingCollection <API_Firebase.SubmitData> add(this BlockingCollection <API_Firebase.SubmitData> submitQueue, API_Firebase.SubmitData submitData)
 {
     if (submitQueue.notNull() && submitData.notNull())
     {
         submitQueue.Add(submitData);
     }
     return(submitQueue);
 }
예제 #3
0
 public static API_Firebase            add(this API_Firebase firebase, API_Firebase.SubmitData submitData)
 {
     if (firebase.notNull() && submitData.notNull())
     {
         firebase.submitThread_Start();           // start a new SubmitThread (if there isn't one alive already)
         firebase.SubmitQueue.add(submitData);    // queues the request for submition
     }
     return(firebase);
 }