def send_sync(self, event, resource_path): if self.options.disable: Logger.warning("SDK is disabled. no operation will be performed") return Logger.debug("Attempting to send event {}".format(event)) res = self.http_client.post( resource_path, json.dumps(EventManager.serialize(event)) ) if res is None or res.status_code != 200: Logger.info("SecureNative failed to call endpoint {} with event {}.".format(resource_path, event)) return res
def send_async(self, event, resource_path): if self.options.disable: Logger.warning("SDK is disabled. no operation will be performed") return item = QueueItem( resource_path, json.dumps(EventManager.serialize(event)), False ) self.queue.append(item) if self._is_queue_full(): self.queue = self.queue[:len(self.queue - 1)]