Giter Site home page Giter Site logo

Comments (6)

amro avatar amro commented on July 19, 2024

Hi Josh,

Are you using 0.3.5? What version of Ruby are you using? I'm not seeing this behavior w/ 1.9.3 and Gibbon 0.3.5. In irb, I can set and retrieve the timeout value without issue.

1.9.3p194 :024 >   g = Gibbon.new('...')
 => #<Gibbon:0x007fba9e89fbd8 @api_key="....", @default_params={:apikey=>"..."}, @throws_exceptions=false> 
1.9.3p194 :025 > g.timeout = 1000
 => 1000 
1.9.3p194 :026 > g.timeout
 => 1000 

Happy to fix the problem if you can help me reproduce it. I'm not sure it's worth targeting Ruby <1.9 but if it's an easy fix, I don't mind.

from gibbon.

twinge avatar twinge commented on July 19, 2024

I found my mistake. I had wrapped the Gibbon.new call in a method, and was calling the method each time. So timeout was getting set on the return from the method, but a new Gibbon object was being created on each invocation of the wrapper method. Subtle mistake. Sorry for bothering you. You might want to delete this issue since it shows your api key :)

from gibbon.

amro avatar amro commented on July 19, 2024

Glad you found the problem and it's working for you.

Bah, thanks. I missed the second occurrence of it. It's disabled now -- no biggie.

from gibbon.

awaage avatar awaage commented on July 19, 2024

I noticed that setting timeout in the options_hash (like the example) does not work:
@client = Gibbon.new(api_key, {:timeout => TIMEOUT})

However, setting the timeout like this works:
@client = Gibbon.new(api_key)
@client.timeout = TIMEOUT

Took a quick look through the code, and I don't see where the timeout is set from options.

from gibbon.

amro avatar amro commented on July 19, 2024

Hi Andrew,

The doc is currently for version 0.4.0, which has not yet been released (because I've yet to fully test it). Version 0.3.5 requires that one set the timeout after initialization, as you've found. I've not yet tested setting the timeout in the options with the latest code.

I hope to release 0.4.0 really soon.

from gibbon.

awaage avatar awaage commented on July 19, 2024

Thanks for the clarification.

from gibbon.

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.