Open mschneider opened 1 year ago
@mschneider willing to work on this issue.
alright! please make sure you check the progress on issue #9 the connected PR is still unmerged
Hey, Sorry to bother you, but what's the update on the connected PR. It contain's AccountSubscriber which is useful for the functionalities I am trying to implement. How do you propose I move forward?
use account subscriber and focus on issue 41 mango v3 functionality is not important at this point
Alright I will.
Hey, I am done with the code, before making a pull request I am just sharing the implementation detail for the same. The websocket works by creating two threads one thread is used for continuously reading from the websocket while other one is use to continuously writing to the socket. The implementation uses:
In the write thread :
In the read thread, it can read two types of response. One is the notification for the subscription and another is the response to the subscription or unsubscription request. The way this thread works is :
I am also attaching a diagram explaining the same workflow.
websocket_workflow.pdf
The advantage I see of this implementation is that we are limiting everything to two threads and to do more subscription only the subscriptions are required to be pushed to the pendingSubscription map. @aniketfuryrocks has volunteered to look at my code and point out the necessary optimisations.@mschneider and @godmodegalactus can you look at this implementation and suggest required changes so that I can move forward towards making a PR for the same.
For a review of an architecture proposal it's easier to look at the interfaces / declaration, rather than the control flow logic. Header file and some pseudo code for tests to see the API in use would be perfect.
@aniketfuryrocks please focus on rust, @OmkarAcharekar should help with review from your end.
Yes I agree with @mschneider, Could you please create a PR to understand your progress on this subject.
onAccountChange onLogs onProgramAccountChange onRootChange onSignature onSignatureWithOptions onSlotChange onSlotUpdate removeAccountChangeListener removeOnLogsListener removeProgramAccountChangeListener removeRootChangeListener removeSignatureListener removeSlotChangeListener removeSlotUpdateListener