public static bool site_Online(this API_Firebase firebase) { if (firebase.site_Configured()) { var randomAreaUri = firebase.site_Uri(10.randomLetters()); // sets a random area randomAreaUri.str().info(); var result = randomAreaUri.GET(); // makes a GET request to it return(result == "null"); // if the URL exists and the AuthToken is valid, we will get a null value as response } return(false); }
public static API_Firebase submitThread_HandleQueue(this API_Firebase firebase) { var next = firebase.next(); while (next.notNull()) { // "[SubmitThread] got next: {0}".info(next); if (firebase.offline() || firebase.site_Configured().isFalse()) { firebase.offlineQueue().add(next); } else { ThreadPool.QueueUserWorkItem((o) => firebase.submit_Via_REST(next)); } next = firebase.next(); } return(firebase); }