Permalink
Browse files

Merge pull request #182 from schnika/master

Do not throw a warning when epoll/kqueue is not supported.
  • Loading branch information...
2 parents 7ca000d + f681365 commit 27c5f411627dc30ce1268923fc9b408652f98050 @stve stve committed Sep 7, 2015
Showing with 8 additions and 3 deletions.
  1. +1 −1 examples/userstream.rb
  2. +7 −2 lib/tweetstream/client.rb
View
2 examples/userstream.rb
@@ -18,7 +18,7 @@
puts direct_message.text
end
-client.on_timeline_status do |status|
+client.on_timeline_status do |status|
puts status.text
end
View
9 lib/tweetstream/client.rb
@@ -414,8 +414,13 @@ def start(path, query_parameters = {}, &block)
if EventMachine.reactor_running?
connect(path, query_parameters, &block)
else
- EventMachine.epoll
- EventMachine.kqueue
+ if EventMachine.epoll?
+ EventMachine.epoll
+ elsif EventMachine.kqueue?
+ EventMachine.kqueue
+ else
+ Kernel.warn('Your OS does not support epoll or kqueue.')
+ end
EventMachine.run do
connect(path, query_parameters, &block)

0 comments on commit 27c5f41

Please sign in to comment.