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

Allow asynchronous processing #21

Closed
bcb opened this issue Sep 19, 2016 · 2 comments
Closed

Allow asynchronous processing #21

bcb opened this issue Sep 19, 2016 · 2 comments
Assignees

Comments

@bcb
Copy link
Member

bcb commented Sep 19, 2016

There's no way to asynchronously process a request, which is a major inadequacy of the library. Should be able to await dispatch. Need a dispatch coroutine, or at least return a future from dispatch.

Will need some heavy refactoring to support both synchronous and asynchronous processing.

@bcb bcb changed the title Allow asynchronous processing (dispatch) Allow asynchronous processing Sep 19, 2016
@bcb
Copy link
Member Author

bcb commented Sep 23, 2016

Could be achievable with a lot of refactoring of dispatch and request modules, (which needs it anyway). Then add an async_dispatcher module which subclasses from those.

Then rather than

from jsonrpcserver import dispatch

You would:

from jsonrpcserver.async_dispatcher import dispatch

Giving the ability to await dispatch.

@bcb bcb self-assigned this Sep 24, 2016
bcb added a commit that referenced this issue Sep 26, 2016
Cleaned up in preparation for adding an asynchronous dispatcher (#21).
The dispatch method has been pared back to it's bare minimum so it can
be easily overridden in a subclass, reproducing as little as possible.
@bcb bcb removed the help wanted label Sep 26, 2016
@bcb
Copy link
Member Author

bcb commented Sep 26, 2016

The request and dispatch modules have been completely restructured and cleaned up, which was sorely needed regardless of this issue.

Now to add asynchronous versions of those modules.

bcb added a commit that referenced this issue Sep 26, 2016
Allows subclasses to specify which request type to instantiate and
process. Continuing the journey to allow asynchronous processing (#21)
@bcb bcb closed this as completed in df10aae Sep 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant