Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: Pausing FilteredStream, adding tracks, then resuming stops stream

$
0
0
I just tested and this works:
private Tweetinvi.Core.Interfaces.Streaminvi.IFilteredStream stream;

privatevoid StartStreamWithTracks(paramsstring[] tracks)
{
    if (stream != null&& stream.StreamState == StreamState.Resume)
    {
        try
        {
            stream.StopStream();
        }
        catch (Exception)
        {
            // Do something
        }
    }
    stream = Stream.CreateFilteredStream();
    foreach (var track in tracks)
    {
        stream.AddTrack(track);
    }
    //stream.MatchingTweetReceived += (o, args) => DoSomething();var t = new Thread(() => stream.StartStreamMatchingAnyCondition());
    t.Start(); 
}

privatevoid queryNotificationReceived(object sender, EventArgs e)
{
    var required = _Flow.GetRequiredData();

    lock (queryList)
    {
        StartStreamWithTracks(required.queries.ToArray());
    }
}

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>