Comments (3)
We're checking it right now.
from ruby.
@aguywithanidea Please, check if you're using 3.5.1 using
Pubnub::VERSION
also:
[2] pry(main)> require 'pubnub'
=> true
[3] pry(main)> p = Pubnub.new(:publish_key => 'demo', :subscribe_key => 'demo')
=> #<Pubnub::Client:0x007fe8aca1da50
@async_events=[],
@env=
{:publish_key=>"demo",
:subscribe_key=>"demo",
:error_callback=>
#<Proc:0x007fe8ad0213c0@/Users/blazeroot/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/pubnub-3.5.1/lib/pubnub/configuration.rb:3 (lambda)>,
:connect_callback=>
#<Proc:0x007fe8ad021398@/Users/blazeroot/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/pubnub-3.5.1/lib/pubnub/configuration.rb:4 (lambda)>,
:ssl=>false,
:timetoken=>0,
:uuid=>"cea11c00-c0d6-4e4b-b7b4-d010e006c93d",
:port=>80,
:origin=>"pubsub.pubnub.com",
:subscribe_timeout=>310,
:timeout=>310,
:max_retries=>10,
:non_subscribe_timeout=>310,
:reconnect_max_attempts=>10,
:reconnect_retry_interval=>10,
:reconnect_response_timeout=>10,
:ttl=>1440,
:secret_key=>0,
:subscriptions=>{},
:callbacks_pool=>{},
:error_callbacks_pool=>{}},
@single_event_connections_pool={},
@subscribe_event_connections_pool={}>
[6] pry(main)> Pubnub::VERSION
=> "3.5.1"
[10] pry(main)> p.publish(:channel => :demo, :message => [1,2]){|e| puts e.response}
=> true
[11] pry(main)> [1,"Sent","13970762135989292"]
[12] pry(main)> channel = 'test_channel'
=> "test_channel"
[13] pry(main)> event = 'hey-there'
=> "hey-there"
[14] pry(main)> payload = {
[14] pry(main)* :channel => channel,
[14] pry(main)* :http_sync => true,
[14] pry(main)* :callback => lambda {|envelope| puts envelope },
[14] pry(main)* :message => {
[14] pry(main)* :action => event,
[14] pry(main)* :data => nil
[14] pry(main)* }
[14] pry(main)* }
=> {:channel=>"test_channel",
:http_sync=>true,
:callback=>#<Proc:0x007fe8ac150f80@(pry):15 (lambda)>,
:message=>{:action=>"hey-there", :data=>nil}}
[15] pry(main)> data = {:key => 'some value'}
=> {:key=>"some value"}
[16] pry(main)> payload[:message][:data] = data
=> {:key=>"some value"}
[17] pry(main)> payload
=> {:channel=>"test_channel",
:http_sync=>true,
:callback=>#<Proc:0x007fe8ac150f80@(pry):15 (lambda)>,
:message=>{:action=>"hey-there", :data=>{:key=>"some value"}}}
[19] pry(main)> p.publish(payload)
#<Pubnub::Envelope:0x007fe8ac9df188>
=> [#<Pubnub::Envelope:0x007fe8ac9df188
@channel="test_channel",
@error=nil,
@error_message=nil,
@first=true,
@history_end=nil,
@history_start=nil,
@last=true,
@message={:action=>"hey-there", :data=>{:key=>"some value"}},
@object=#<Net::HTTPOK 200 OK readbody=true>,
@payload=nil,
@response="[1,\"Sent\",\"13970763907625953\"]",
@response_message="Sent",
@service=nil,
@status=200,
@timetoken="13970763907625953",
@timetoken_update=nil>]
Are you using your own keys or demo? Does your code works for you using demo keys?
from ruby.
This is a case of user error. Our dev env where we're getting strange behavior is running 3.5.1, but looks like when I spun up my rails console to verify (and send you the issue above), I was running 3.4.1.
False alarm - we have another issue, but one that does not appear to be related to this version of the gem. Sorry for the false alarm.
from ruby.
Related Issues (20)
- Publishing message error HOT 7
- Unsubscribe? HOT 4
- Exception inside SubscribeCallback is getting ignored
- presence method does not get a callback on join events HOT 7
- "less than 100ms" HOT 4
- PubNub 3.4 for Ruby Released HOT 3
- Hardcoded log file HOT 4
- uninitialized constant Pubnub::Configuration::PUBNUB_VERSION HOT 8
- This application keeps requesting messages from the database forever HOT 5
- Synchronous publish? HOT 9
- Multi-process access in Heroku environment causes PubNub initialization to occasionally fail HOT 7
- Problems with PAM ttl in 3.5.0beta HOT 2
- 3.5.0 Release Candidate Available
- Logger invocations should use progname HOT 4
- event machine not initialized exception HOT 2
- MXing with Ruby
- Publish on multiple channels doesn't work HOT 4
- Error on publish "eventmachine not initialized" HOT 19
- Retrieve message uuid from ruby api HOT 6
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 ruby.