private void AddEngageMessage(MixpanelMessage message) { Debug.Assert(message != null); if (EngageMessages == null) { EngageMessages = new List <List <MixpanelMessage> >(); } AddBatchMessage(EngageMessages, message); }
private void AddTrackMessage(MixpanelMessage message) { Debug.Assert(message != null); if (TrackMessages == null) { TrackMessages = new List <List <MixpanelMessage> >(); } AddBatchMessage(TrackMessages, message); }
private void AddEngageMessage(MixpanelMessage message) { Debug.Assert(message != null); if (EngageMessages == null) { EngageMessages = new List<List<IDictionary<string, object>>>(); } AddBatchMessage(EngageMessages, message); }
private void AddEngageMessage(MixpanelMessage message) { Debug.Assert(message != null); if (EngageMessages == null) { EngageMessages = new List<List<MixpanelMessage>>(); } AddBatchMessage(EngageMessages, message); }
private void AddBatchMessage(List<List<IDictionary<string, object>>> list, MixpanelMessage message) { Debug.Assert(list != null); Debug.Assert(message != null); var lastInnerList = list.LastOrDefault(); bool newInnerListNeeded = lastInnerList == null || lastInnerList.Count >= MaxBatchSize; if (newInnerListNeeded) { var newInnerList = new List<IDictionary<string, object>> { message.Data }; list.Add(newInnerList); } else { lastInnerList.Add(message.Data); } }
private void AddBatchMessage(List <List <MixpanelMessage> > list, MixpanelMessage message) { Debug.Assert(list != null); Debug.Assert(message != null); var lastInnerList = list.LastOrDefault(); bool newInnerListNeeded = lastInnerList == null || lastInnerList.Count >= MaxBatchSize; if (newInnerListNeeded) { var newInnerList = new List <MixpanelMessage> { message }; list.Add(newInnerList); } else { lastInnerList.Add(message); } }
private void AddTrackMessage(MixpanelMessage message) { Debug.Assert(message != null); if (TrackMessages == null) { TrackMessages = new List<List<MixpanelMessage>>(); } AddBatchMessage(TrackMessages, message); }