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

implement session handling for unsubscribe in subxt-client #242

Merged
merged 3 commits into from Mar 9, 2021

Conversation

gregdhill
Copy link
Contributor

Signed-off-by: Gregory Hill gregorydhill@outlook.com

@@ -102,12 +111,19 @@ impl SubxtClient {
pub fn new(mut task_manager: TaskManager, rpc: RpcHandlers) -> Self {
let (to_back, from_front) = mpsc::channel(DEFAULT_CHANNEL_SIZE);

let request_id = Arc::new(RwLock::new(u64::MIN));
Copy link
Member

@niklasad1 niklasad1 Mar 9, 2021

Choose a reason for hiding this comment

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

I don't understand why you instantiate these here, inside task::spawn should work?

Copy link
Member

Choose a reason for hiding this comment

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

I guess because the main closure is for each FrontToBack message. That said the context could be expanded although that is already an extremely indented block of code.

@@ -102,12 +111,19 @@ impl SubxtClient {
pub fn new(mut task_manager: TaskManager, rpc: RpcHandlers) -> Self {
let (to_back, from_front) = mpsc::channel(DEFAULT_CHANNEL_SIZE);

let request_id = Arc::new(RwLock::new(u64::MIN));
Copy link
Member

Choose a reason for hiding this comment

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

I guess because the main closure is for each FrontToBack message. That said the context could be expanded although that is already an extremely indented block of code.

client/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@ascjones ascjones left a comment

Choose a reason for hiding this comment

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

LGTM

@ascjones
Copy link
Member

ascjones commented Mar 9, 2021

Not sure whether to merge this or not, the CI is failing. Says that we should merge this first here: #243.

Where will the build errors with FrontToBack be fixed @gregdhill?

@gregdhill
Copy link
Contributor Author

Cargo seems to default to 0.2.0-alpha.2 for jsonrpsee. Working on a fix now.

Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
@niklasad1 niklasad1 merged commit c1d4804 into paritytech:master Mar 9, 2021
@gregdhill gregdhill deleted the subxt-client-unsubscribe branch March 9, 2021 22:01
@ascjones ascjones mentioned this pull request Mar 22, 2021
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.

None yet

3 participants