Thanks for your comments in the code. The problem was trying to use anonymous methods and Lamda functions in VB, and having more strict type checking to deal with too - so this C# code
Two other points.
var tweetHelper = TweetinviContainer.Resolve<ITweetHelper>();
var result = Search.SearchTweets(GenerateSearchBeforeMaxId(maxId)).ToArray();
var lastTweetId = tweetHelper.GetOldestTweetId(result.Select(x => x.TweetDTO));
now looks like this under VB.Net Dim tweetHelper As ITweetHelper = TweetinviContainer.Resolve(Of ITweetHelper)()
Dim result As IEnumerable(Of ITweet) = Search.SearchTweets(GenerateSearchBeforeMaxId(maxId)).ToArray()
Dim lastTweetId As Long = tweetHelper.GetOldestTweetId(result.Select(Function(x) (x.TweetDTO)))
Thanks.Two other points.
-
I will need to consider rate limits for this approach. So I will possibly need to tweak the routine to be able to be reentered later and carry on where it left off once the rate limits are reset.
-
I was interested in you last comment about duplicates. You are saying that the some of the Tweets in the block of missed data can still be picked up as live events when streams are restarted ? That is bad news. Is this a transitory thing?, i.e. does it looks as if it is a race condition because events are already in the process of being sent to the stream? Or can this happen minutes or even hours later. I need to find a way to deal with this but cannot rely on RDBMS to trap the duplicates. My tweets go into a proprietary queue data structure so I would have to keep a record of all IDs and check for duplicates whenever a new one is presented. But obviously this cannot be done indefinitely - hence my question about whether this is transitory?