Code Monkey home page Code Monkey logo

Comments (3)

blazeroot avatar blazeroot commented on July 30, 2024

We're checking it right now.

from ruby.

blazeroot avatar blazeroot commented on July 30, 2024

@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.

aguywithanidea avatar aguywithanidea commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.