-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on publish "eventmachine not initialized" #5
Comments
hmm.. looks pretty boilerplate. how often do you get this, and how fast are you publishing ? |
@geremyCohen I've isolated the issue a bit more. Check out the updated code above. |
Are you using any other EM-based code that may be stopping/restarting the reactor ? And please tell me how often it occurs, how fast you are publishing? |
ok, thanks, I didnt get the page update until just now. |
This is strange. Seems like some sort of scoping issue on the callback.
but
|
wait, thats not it. still researching... |
@geremyCohen thanks... I can't seem to figure it out. Do you have a hack that would work in the interim? |
I see the issue, and I will see if I can find a workaround or fix for you... |
Does your app require EM anywhere else? |
Not in any of my files. Here are my gem's
|
My source 'https://rubygems.org'
gem 'aws-sdk', '~> 1.0'
gem "pubnub", "~> 3.3.0.7"
gem 'sinatra'
gem 'shotgun'
gem 'commander'
gem 'terminal-table'
gem 'promise'
group :test do
gem "test-unit", "1.2.3"
gem "rack-test"
gem "simple_mock", "~> 0.0.2"
gem "factory_girl", "~> 4.0"
gem "minitest-reporters"
end |
The issue occurs because we are chaining calls. This is an issue with this version of the gem. Our new gem is in closed beta that lets you chain stuff... let me know if you'd be interested in checking it out. In the meantime, the easiest workaround for you is to use our blocking publish for your publish: https://github.com/pubnub/ruby/blob/master/3.3/app/models/blocking_pub.rb This way, there is no race condition between the two operations. But real solution is in new version, let me know if you are interested in checking it out. geremy |
@geremyCohen can I ask why callbacks are used at all? I don't really see the reason for non-blocking in the case of |
The new gem lets you choose whether or not to use callbacks or blocks, and whether to block or not in the response. :) |
In general, if you are concerned about server response before continuing, you can block and wait for it and handle it as it happens. Otherwise, if you choose to be fully async and not block using callbacks, you can do that as well. |
@geremyCohen eta on the new gem? |
I can send it to you... contact us at support @ pubnub and we'll set you up (its a closed beta) |
done. |
cool. we also tested your code on it successfully. I'll followup shortly offline via email. |
I get this error when calling the
pubnub.publish
method for reasons that are unclear:My code looks like such.
I'm using ruby 2.0.0 with
pubnub (3.3.0.7)
Any help would be swell.
The text was updated successfully, but these errors were encountered: