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

Revisit how wws-server and wws-worker communicates together #110

Open
Angelmmiguel opened this issue Mar 15, 2023 · 0 comments
Open

Revisit how wws-server and wws-worker communicates together #110

Angelmmiguel opened this issue Mar 15, 2023 · 0 comments
Labels
🚀 enhancement New feature or request

Comments

@Angelmmiguel
Copy link
Contributor

Is your feature request related to a problem? Please describe.

This is not an issue, but a refactor

The wws-server uses the wws-worker crate to get a response for the different requests. To run the worker module, it requires to transform the input from a HttpRequest to WasmInput (JSON) and the output from WasmOutput (JSON) to a HttpResponse.

The input transformation is done in the wws-worker while the output is managed by the wws-server. This is an incosistent behavior.

Describe the solution you'd like

We should establish the right boundaries and moving transformations to a single place. I would say the wws-worker shouldn't require on actix-web. For this reason, the input transformations must be moved to wws-server and keep wws-worker to work only with WasmInput and WasmOutput structs.

Describe alternatives you've considered

I also considered to move the output transformation logic to the wws-worker crate. However, this approach reduces the reusability of the wws-worker crate as it now depends to actix-web.

Additional context

This conversation started on #106 (comment)

@Angelmmiguel Angelmmiguel added the 🚀 enhancement New feature or request label Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant