Comments (8)
@siftrics let me know if you are okay with this. I would like to pick this up.
from sight-clojure.
Certainly. We can coordinate to get an API key dedicated for the tests.
from sight-clojure.
@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.
@siftrics why is there a (Thread/sleep 500)
in the do-poll
function ?
from sight-clojure.
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.
@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.
@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.
#3 closes this
from sight-clojure.
Related Issues (2)
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 sight-clojure.