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

build tags so that the code could run on Cloudflare and Wazero #123

Closed
gedw99 opened this issue Aug 8, 2024 · 3 comments
Closed

build tags so that the code could run on Cloudflare and Wazero #123

gedw99 opened this issue Aug 8, 2024 · 3 comments

Comments

@gedw99
Copy link

gedw99 commented Aug 8, 2024

I am having a lot of success with workers, but would love to be able to run the workers on Wazero too.

Should we use build tags so that we can run the WASM on Cloud flare but also Wazero ?

@gedw99 gedw99 changed the title build tags to make the code reusable ? build tags so that the code could run on Cloudflare and Wazero Aug 8, 2024
@syumai
Copy link
Owner

syumai commented Aug 8, 2024

@gedw99 This sounds interesting. Could you please give an example of what kind of program you would like to run on both workers and wazero?

@gedw99
Copy link
Author

gedw99 commented Aug 8, 2024

Hey @syumai

I am wrote this up a bit better now.

Programs that live on your origin server, but where certain things can be offloaded also to CF works, CF R2, etc

For example Pocketbase is a very cable server with a SQLITE DB etc. You would run that on your Origin Server. Maybe Hetzner or Fly.io.

Then you have all the processing that your need to do, which will use the Pocketbase Sever.
These processes represent web pages or anything. The point is that if we can run them on the Origin server AND on Cloud flare workers, we can offload work from the Origin server.

Because each wasm file cant be very big the idea is that each Page is its own was file.
These can run on Origin under Wazero or on CF.

They both will call the Pocketbase server to access data and do advanced Auth flows that Pocktbase can do.

As far as I know the only thing we need to do this is for the Fetch call to be able to run on CF and not on CF. You already. have the asset gen cmd. Maybe a similar thing for the Fetch layer too, so that it's flexible for different runtimes.

https://github.com/dispatchrun/net/network/dependents has examples

https://github.com/vasilev/HTTP-request-from-inside-WASM is one example.

@gedw99
Copy link
Author

gedw99 commented Nov 7, 2024

Closing due to no response

@gedw99 gedw99 closed this as completed Nov 7, 2024
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

No branches or pull requests

2 participants