kopf / httsleep Goto Github PK
View Code? Open in Web Editor NEWA python library for polling HTTP endpoints - batteries included!
License: Apache License 2.0
A python library for polling HTTP endpoints - batteries included!
License: Apache License 2.0
Users may already have a requests.Session
object and wish to reuse that rather than having httsleep
create a blank one. This would save users from re-entering standard headers, settings etc. that they've already configured elsewhere.
httsleep(url, until=until, alarms=alarms, session=my_session)
poller = HttSleeper(url, until=until, alarms=alarms)
poller.session = my_session
poller.run()
Not usable because here the request is prepared without the context of the Session:
response = self.session.send(self.request.prepare()
The workaround would be usable if this line was instead:
response = self.session.send(self.session.prepare_request(request))
Improve documentation such that:
It's not currently possible to use httsleep
and ignore certificate errors, as you would with requests.get(..., verify=False)
.
This looks fairly simple to add so I'll try to follow this with a PR and hopefully we can improve things.
In my case I create a job and want to poll until that job has completed. There is only one endpoint and it gives me the list of jobs that are in progress. If my job is not on the list - it's completed. Example response body:
[
{"id": 1}, {"id": 2}, {"id": 3}
]
I want to poll until returned json does not contain my id. Any idea how can I write that condition?
Is there any reason why the dependency on jsonpath-rw can't be made optional?
Deprecate and remove convenience kwargs (status_code
etc), leaving just until
and alarms
(hi @MathMagique - I've relented! ;) )
I know Python 2.6 is quite an old version :)
But dict comprehensions doesn't appear until Python 2.7, so below from main.py
Line 81 would fail:
until.append({k: v for k, v in condition.items() if v})
Maybe a simple plain alternative list append is enough.
Add "httsleep from the command line"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.