Closed heaven closed 9 years ago
Hi @heaven, I'm afraid I'm not quite sure what you're asking for here - is this a pull request, or are you asking for support? I'm not sure I understand your question
Closing due to lack of activity.
@dugjason I was pointing that there's no stop method to shut down the streams gracefully.
@heaven you do that be unsubscribing from the stream as per https://github.com/datasift/datasift-ruby/blob/master/examples/live_stream_eg.rb#L34
So if I have the next code:
self.streams << Thread.new do
on_delete = proc { ... }
on_error = proc { ... }
on_message = proc { ... }
on_open = proc { ... }
on_ds_message = proc { ... }
self.consumers << consumer = DataSift::new_stream(@config, on_delete, on_error, on_open)
consumer.on_datasift_message = on_ds_message
consumer.stream.read_thread.join
end
How do I stop the stream consumer?
I have the next patches:
In my
start
method I have something like this:And the
stop
method does look like this:And it freezes at this line:
self.streams.each(&:join)
so I have to usekill
instead.