/// <summary> /// Gets the user. /// </summary> /// <returns></returns> internal async Task<MixpanelClient> GetMixpanelClient() { if (_client != null) return _client; _client = await MixpanelClient.GetCurrentClient(); return _client; }
public static async Task <MixpanelClient> GetCurrentClient() { if (_current != null) { return(_current); } _current = new MixpanelClient(); await _current.TrySendLocalElements(); return(_current); }
/// <summary> /// Gets the current Mixpanel client instance. /// </summary> /// <returns></returns> public static MixpanelClient GetCurrentClient() { if (_current != null) { return(_current); } _current = new MixpanelClient(); ThreadPool.QueueUserWorkItem(new WaitCallback(delegate { _current.TrySendLocalElements(); })); return(_current); }
/// <summary> /// Gets the current Mixpanel client instance. /// </summary> /// <returns></returns> public static MixpanelClient GetCurrentClient() { if (_current != null) return _current; _current = new MixpanelClient(); ThreadPool.QueueUserWorkItem(new WaitCallback(delegate { _current.TrySendLocalElements(); })); return _current; }
/// <summary> /// Resets the current Mixpanel client to a specific instance. /// </summary> /// <param name="client">The client.</param> /// <returns></returns> public static void ResetClient(MixpanelClient client) { _current = client; }
/// <summary> /// Gets the current Mixpanel client instance. /// </summary> /// <returns></returns> public static MixpanelClient GetCurrentClient(bool offlineEnabled = true) { if (_current != null) { _current._isOfflineEnabled = offlineEnabled; return _current; } _current = new MixpanelClient(); _current._isOfflineEnabled = offlineEnabled; if (offlineEnabled) { ThreadPool.QueueUserWorkItem(new WaitCallback(delegate { _current.TrySendLocalElements(); })); } return _current; }