Skip to content

Added slot update subscribe and unsubscribe - #88

Open
pratyaxsh wants to merge 2 commits into
mschneider:mainfrom
pratyaxsh:slotUpdate
Open

pratyaxsh wants to merge 2 commits into
mschneider:mainfrom
pratyaxsh:slotUpdate

Conversation

@pratyaxsh

Copy link
Copy Markdown
Collaborator

This pr implements the functions onSlotUpdate and removeSlotUpdateListener associated with #41 The aim here is to get notification whenever any of the slot is updated.

Comment thread lib/solana.cpp
sess->unsubscribe(sub_id);
}

int WebSocketSubscriber::onSlotUpdate(Callback callback,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

params should be an input variable for all of the methods.

Comment thread tests/main.cpp
};
int sub_id = sub.onSlotUpdate(on_callback, solana::Commitment::CONFIRMED,
on_subscribe, on_unsubscribe);
sleep(10);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid sleep in all your code. Use futures.

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