Comments (8)
Have you looked into why Twitter::JSONStream
isn't reconnecting for us? I believe it should be.
from tinder.
By default Twitter::JSONStream has no special behavior around a response with a non-200 status code, but it allows you to specify an on_error callback to handle this case. This commit introduces an error handler which raises an exception in these cases. Removing the raising of the exception may be necessary but also may not be sufficient to allow Twitter::JSONStream to reconnect in those cases. Perhaps @joshwand who wrote that commit may have some further insight.
from tinder.
@noahd1: I think you're on the right track that removing the raise of the exception might allow Twitter::JSONStream to reconnect. Feel free to play around and submit a pull request.
from tinder.
As I suspected, it is necessary to remove that exception, but not entirely sufficient, (at least in cases that I'm seeing). Unfortunately, this is rather difficult to test, as the problems seem to arise after long periods of inactivity. I do see a couple of reconnection attempts, and then I get this stacktrace:
2011-10-09 23:56:43 | FATAL | CampfireBot::Bot | Unhandled exception while listening to room devops: Could not parse data entirely
/var/lib/jenkins/campfire-bot/vendor/ruby/1.8/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:121:in `<<'
/var/lib/jenkins/campfire-bot/vendor/ruby/1.8/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:121:in `receive_data'
/var/lib/jenkins/campfire-bot/vendor/ruby/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/var/lib/jenkins/campfire-bot/vendor/ruby/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
/var/lib/jenkins/campfire-bot/vendor/ruby/1.8/bundler/gems/tinder-e3c8012dc127/lib/tinder/room.rb:151:in `listen'
The error causes the program to exit of course. Any ideas on what this might be?
from tinder.
I'm having the exactly same problem. I can reproduce this 90% of time just by sleeping a certain amount of time (eg. 10 seconds) in my listen callback.
from tinder.
Yes, I can concur with @massive that some kind of timeout causes the problem for me, too. I found that the effective delay is because I'm using a blocking network connection talking to another service to feed the campfire stream. I switched to using Thread to make it non blocking and it's working fine now, if that helps.
from tinder.
My remedy for this was to execute code via EventMachine. Eg. executing long running shell commands with EM.system fixed the issue.
from tinder.
Hi there! We're doing some open source maintenance work and closing old issues. If this issue is still applicable or you would still like it to be addressed, please re-open the issue by April 17, 2017. Thanks!
from tinder.
Related Issues (20)
- Rubyforge API docs and website are outdated. HOT 3
- Tinder explicitly requires Hashie ~>1.0, Hashie is moving to 2.0 soon.
- Silent failure to post HOT 1
- Room Transcript method fails HOT 1
- No method 'available_transcript' exists HOT 1
- Cannot create room HOT 1
- room.upload not working
- Release v1.9.3 on rubygems.org HOT 10
- Increase streaming timeout HOT 2
- MIT-LICENSE - typos ; please add correct license information HOT 3
- faraday_middleware dependency HOT 2
- Tinder::Connection ssl should allow passing any ssl_options to Faraday - fails HOT 1
- Room Creation Date HOT 1
- New release? HOT 2
- find_room_by_name returning nil HOT 4
- request to follow SemVer/mention it in README HOT 3
- Tinder Boost API HOT 1
- relax dependency on faraday
- Add support for Ruby2.7?
- Required Headers for API, only X-Auth-Token?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinder.