Giter VIP home page Giter VIP logo

Comments (8)

ashwinbhaskar avatar ashwinbhaskar commented on July 23, 2024 1

@siftrics let me know if you are okay with this. I would like to pick this up.

from sight-clojure.

siftrics avatar siftrics commented on July 23, 2024

Certainly. We can coordinate to get an API key dedicated for the tests.

from sight-clojure.

ashwinbhaskar avatar ashwinbhaskar commented on July 23, 2024

@siftrics can you add the expected responses of this call

 (clj-http.client/post
                   "https://siftrics.com/api/sight/"
                   {:headers            {"Authorization" (str "Basic " (:apikey client))}
                    :body               (json/write-str payload)
                    :content-type       :json
                    :socket-timeout     10000               ;; in milliseconds
                    :connection-timeout 10000               ;; in milliseconds
                    :accept             :json})

Or is there a way for me to test it out (maybe with a dummy api key). Because I want to write tests for success and failure scenarios. So need to know how the actual response looks like

from sight-clojure.

ashwinbhaskar avatar ashwinbhaskar commented on July 23, 2024

@siftrics why is there a (Thread/sleep 500) in the do-poll function ?

from sight-clojure.

siftrics avatar siftrics commented on July 23, 2024

The sleep is because we don't want to be continuously firing GET requests at the polling endpoint. There needs to be some delay between each request. 500 milliseconds seemed like a good midpoint between not wasting too much time and not hitting the endpoint too hard, although 1000 milliseconds might make a bit more sense.

I am super busy. I'll get the dummy API key set up eventually.

from sight-clojure.

siftrics avatar siftrics commented on July 23, 2024

@ashwinbhaskar Hey, man. I want to let you know I haven't forgotten about this. I have a lot of other things to tend to besides tests. I estimate I'll get to this over the weekend, when business cools down a bit.

from sight-clojure.

ashwinbhaskar avatar ashwinbhaskar commented on July 23, 2024

@siftrics sure, no worries:)

The sleep is because we don't want to be continuously firing GET requests at the polling endpoint. There needs to be some delay between each request.

The GET request in the code is a synchronous one. It will wait for the response, process it before it makes the next call. So the network call latency and the response time of the server would anyway be around 500ms right? If that's the case then the extra sleep of 500ms will only hamper the UX.

from sight-clojure.

siftrics avatar siftrics commented on July 23, 2024

#3 closes this

from sight-clojure.

Related Issues (2)

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.