[do not merge] improving + adding features to go client#19
Conversation
|
still a skeleton, but i have placeholders for what i think is the http api? some of the paths didnt work, and i had to change a ioredis setting as well for my test to pass, i'm not too sure why. it complained that the maxretrycount for redis connection was null since the basepath and token is already in the client, i felt it made sense to also use it to dial websocket so i added them, but i havent updated anything to use those functions yet. also, for some reason, you were passing token with a query parameter, but i don't understand because i couldn't see anywhere in the ts where you were parsing the token as a query param (i only see the authorization header), maybe im missing something |
|
@manast ok i filled in a bunch of stuff, still not completely done, but let me know if this is on the right path to what you wanted. i added context.Context to some of the existing wss based functions as well, a few are still missing proper ctx handling tho |
|
Sorry for the delay in reviewing this, I will do it asap- |
manast
left a comment
There was a problem hiding this comment.
Thanks for the PR. I saw you spent some time on the WS version of the Proxy. I think it will be more important to focus on the HTTP version first. But still your changes are good to have as we will finalize the WS in the future as well.
Anyway, I wrote some comments. It would be great to have a couple more of tests for this new functionality.
| _, err = c.httpClient.R(). | ||
| SetBody(jobs). | ||
| SetResult(out). | ||
| ForceContentType("application/json"). |
There was a problem hiding this comment.
resty should be configured to use JSON by default so that it is not required to use ForceContentType here.
There was a problem hiding this comment.
i wasn't sure about this because some endpoints seem to return an OK instead of "OK". since the first is not valid JSON i am worried.
| @@ -0,0 +1,26 @@ | |||
| package proxyapi | |||
|
|
|||
| type GetJobsResponse struct { | |||
There was a problem hiding this comment.
I think maybe it is more standard to have one file per struct instead of having all in this generic file.
There was a problem hiding this comment.
ive been splitting these out into files that make sense as ive been getting more familiar with the api.
| if (config.redis.url) { | ||
| connection = new IORedis(config.redis.url, { | ||
| retryStrategy: () => 3000, | ||
| maxRetriesPerRequest: 20, |
There was a problem hiding this comment.
This is strange because I think this is the default value (20) for maxRetriesPerRequest in IORedis.
There was a problem hiding this comment.
yes this was really odd. for some reason it crash on my computer when it is null. maybe it is my bun version?
There was a problem hiding this comment.
No, I don't think so, what error do you get?
|
@manast here is the error when i dont manually specify the ioredis setting. (it in fact tells me to set to not be null) as for websocket - if it's not finalized yet then that's fine. I just saw some issues with the impl and so did some small fixes. |
hi, im opening this pr just so you can see what im up to.
if you have any questions or wants, please bring them up
i will also ask questions to you if i have them in this PR, if that is okay? @manast