python-simple-rest-client icon indicating copy to clipboard operation
python-simple-rest-client copied to clipboard

suggestion regarding async

Open dearkafka opened this issue 2 years ago • 3 comments

Hi! I've been using simple-rest-client for https://github.com/dearkafka/woot and I liked the logic so far, but I just hacked it a little bit for better __repr__ and stuff. But I was thinking that maybe how async is currently made is not the best way? the thing is right now async client will be closed every time and that means that user need to re-init presumable the whole class of api with resource, right? that does not sound so great, also sync logic allows to be re-used easily. I hacked this too in my repo but thats not so elegant since I wanted to avoid redefining your own code (https://github.com/dearkafka/woot/blob/aebb9d5051fe73101e0ab01ac335d12aa044160d/woot/resources.py#L137)

what do you think about this issue?

dearkafka avatar Apr 23 '23 16:04 dearkafka

so, to be precise, I dont have a PR or solution right away as Im not sure myself how to tackle it best. But I noticed that I cant even use different actions inside 1 resource, so I made a client for every action call. that presumably also not so great.

dearkafka avatar Apr 23 '23 16:04 dearkafka

@dearkafka Hello, I think this problem was fixed in version 1.2.0, now async can be re-used (https://github.com/allisson/python-simple-rest-client/issues/56).

allisson avatar Oct 03 '23 20:10 allisson

yes, I believe it is

dearkafka avatar Oct 03 '23 21:10 dearkafka