Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added spot ws service, moved client to common, refactoring #633

Merged

Conversation

vigodsky
Copy link
Contributor

@vigodsky vigodsky commented Nov 15, 2024

Hi,

Here I implemented Binance spot ws service and did some refactoring.

Common mechanics of websocket client I moved to common/websocket package (it's identical for each service, I don't want to have duplicates). Configuration of endpoint, using keep alive and other parameters can be used like in general way of this lib - from global vars of each package. So setting up common client can be done flexible and without breaking main architecture.

For example,
We can create futures.NewOrderPlaceWsService, which uses its own function to establish connection/resolving url/using keepalive and so on. Check code in constructor for more details.

I also tried to reduce some interfaces, change naming for better following SRP.

Thanks

@vigodsky vigodsky force-pushed the feat/add-spot-ws-order-place-service branch from f3bed24 to 25699e7 Compare November 15, 2024 13:59
@xyq-c-cpp
Copy link
Collaborator

xyq-c-cpp commented Nov 25, 2024

good job, but somebody ask me some questions:

My question is regarding websocket reconnection. From the code I reviewed, it seems that keepalive is being handled for the ping/pong stream, but I don’t see any part of the code that disconnects the connection every 24 hours.

Has this functionality not been developed yet? If not, how can I resolve the issue of disconnection every 24 hours? (I would appreciate it if you could provide an example code.)`

can you answer that question?
@vigodsky

@xyq-c-cpp xyq-c-cpp merged commit 0d0d7ba into adshao:master Nov 25, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants