Search code examples
elixirtwitter-streaming-api

How do I interupt an (infinite) stream?


I'm working with the ExTwitter library and would like to be able to occasionally kill a call to the streaming API to change parameters.

My current code looks something like this:

for tweet <- ExTwitter.stream_filter(track: terms) do
    process_tweet tweet
end

Is there anything I could do to indicate that I don't want any more messages?


Solution

  • Thanks for trying out. I could confirm the method Chris indicated works. As an alternative approach, I put one trial as an API method call in the following (though I'm not confident how to take infinite stream properly yet).

    https://github.com/parroty/extwitter/issues/2