You are viewing a single comment's thread from:

RE: Quick Update: Making My Hive-Engine Script Faster

in #coding2 months ago

I could now open a connection to an API server, and "stream" everything within the connection, without having to make individual queries, opening and closing the connection between each of them.

I've also seen your reply and I'm happy to see that I had roughly understood the idea behind this tool! Basically, if I have 3 calls I need to send to the API, instead of doing "open-do_A-close", "open-do_B-close" and "open-do_C-close" (9 steps total), I can do "open-do_A-do_B-do_C-close", reducing the steps to 5, right?

Btw, I'm happy this addition might help you in the future :)

Sort:  

Yes I believe that's exactly how it works. Oh, and with requests.Session() as session: opens and keeps the connection up as long as you use it, and then automatically closes it when the operation is finished, so you don't need to close it yourself at the end of your program with session.close().

As soon as I had submitted my last post about the new and "improved" liquidity fetching script, I realized it was riddled with new bugs, and some old ones somehow raised their ugly heads, so I had to do some bug hunting again. I think I am finally done with the scripts, and I think I might release both of them in the coming days. I just have to do some clean-up, and maybe prettify their output a little. Also need to write some instructions on how to use them, so...

Keep it up! Your are almost there :) can't wait to read and analize it again and see if I can learn even more new stuff! Meanwhile I've also started working again on my script too and I'm trying to make it more useful... and, if I can, at least a bit better than what it used to be!