Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Asyncify the client #3230

Open
tomaka opened this issue Jul 29, 2019 · 4 comments
Open

Asyncify the client #3230

tomaka opened this issue Jul 29, 2019 · 4 comments
Labels
I4-annoyance The client behaves within expectations, however this “expected behaviour” itself is at issue. I7-refactor Code needs refactoring. Z4-involved Can be fixed by an expert coder with good knowledge of the codebase.

Comments

@tomaka
Copy link
Contributor

tomaka commented Jul 29, 2019

Right now the client is synchronous. This is particularly bad for light client requests, which just block the current thread.

Considering the difficulty of doing this, there's no point in tackling this issue before async/await are stable.

@tomaka tomaka added I4-annoyance The client behaves within expectations, however this “expected behaviour” itself is at issue. I7-refactor Code needs refactoring. M4-core Z4-involved Can be fixed by an expert coder with good knowledge of the codebase. labels Jul 29, 2019
@tomaka
Copy link
Contributor Author

tomaka commented Jul 29, 2019

Alternatively, we could debate changing the architecture to make the Client correspond to a full-client only, and use another layer on top of the Client when we need to abstract over both full and light clients.

@gterzian
Copy link
Contributor

Do you have an example of a current sync api, and how it would look once "asyncified"?

@tomaka
Copy link
Contributor Author

tomaka commented Jul 29, 2019

The offenders are:

Instead of blocking waiting for the Future to resolve, we should also return a Future.
This probably propagate throughout the entire library and throughout Substrate. Whenever you need to fetch any information from the client, it would have be an asynchronous call.

@expenses
Copy link
Contributor

Those specific calls were removed as of 8426cf1. Is there much that can be done for this at present?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I4-annoyance The client behaves within expectations, however this “expected behaviour” itself is at issue. I7-refactor Code needs refactoring. Z4-involved Can be fixed by an expert coder with good knowledge of the codebase.
Projects
None yet
Development

No branches or pull requests

4 participants