Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

use call_actor callback for better reusability of library#207

Merged
stevelr merged 19 commits intomainfrom
fix/httpserver-send-closure
Mar 24, 2023
Merged

use call_actor callback for better reusability of library#207
stevelr merged 19 commits intomainfrom
fix/httpserver-send-closure

Conversation

@stevelr
Copy link
Contributor

@stevelr stevelr commented Feb 16, 2023

Most of the functionality of the httpserver capability provider is wrapped in a library wasmcloud-provider-httpserver, which was intended to provide a reusable, embeddable http server library.

This change improves the reusability of the library by allowing customization of call_actor: the asynchronous function that delivers the http payload to an actor, waits for the result, and returns the response to the http caller.

With this change, the http server can use different transports to communicate with the actor, for example, by sending the http payload over nats, instead of wasmbus-rpc.

The wasmcloud-provider-httpserver library has not yet been published to crates.io. We'd like to publish it as a crate after this PR is merged.

Signed-off-by: stevelr <steve@cosmonic.com>
Signed-off-by: stevelr <steve@cosmonic.com>
Signed-off-by: stevelr <steve@cosmonic.com>
Signed-off-by: stevelr <steve@cosmonic.com>
@stevelr
Copy link
Contributor Author

stevelr commented Feb 22, 2023

Dependent on wasmCloud/wasmcloud-test#24, which is in turn dependent on wasmCloud/weld#143

Signed-off-by: stevelr <steve@cosmonic.com>
Signed-off-by: stevelr <steve@cosmonic.com>
@stevelr
Copy link
Contributor Author

stevelr commented Feb 22, 2023

  • For safety, sets a maximum size of incoming content to 100MB. The maximum can be adjusted anywhere from 0 bytes to 1 GB by setting max_content_len in the configuration settings or in the linkdef values.

@stevelr
Copy link
Contributor Author

stevelr commented Feb 22, 2023

Other than references in Cargo.toml (which will be changed when dependent PRs are merged), this is ready for review

@stevelr stevelr marked this pull request as ready for review February 22, 2023 17:34
@stevelr
Copy link
Contributor Author

stevelr commented Feb 28, 2023

blocked on wasmCloud/wasmcloud-test#24

Signed-off-by: stevelr <steve@cosmonic.com>
Signed-off-by: stevelr <steve@cosmonic.com>
Signed-off-by: stevelr <steve@cosmonic.com>
Signed-off-by: stevelr <steve@cosmonic.com>
Copy link
Member

@brooksmtownsend brooksmtownsend left a comment

Choose a reason for hiding this comment

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

LGTM once git dependencies are pinned dependencies

Signed-off-by: stevelr <steve@cosmonic.com>
@stevelr stevelr requested a review from brooksmtownsend March 24, 2023 00:44
@stevelr stevelr self-assigned this Mar 24, 2023
@stevelr
Copy link
Contributor Author

stevelr commented Mar 24, 2023

Note: after this PR is merged, tag and release wasmcloud-httpserver-provider library as a new crate

Signed-off-by: stevelr <steve@cosmonic.com>
stevelr added 2 commits March 24, 2023 10:14
Signed-off-by: stevelr <steve@cosmonic.com>
Signed-off-by: stevelr <steve@cosmonic.com>
@stevelr stevelr merged commit c68fe64 into main Mar 24, 2023
@stevelr stevelr deleted the fix/httpserver-send-closure branch March 24, 2023 19:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants