Cloudflare Workers still needs time. It's already marked as WIP. First, let's specify for which situations it's a good option. You can use it for projects with small file sizes, controllable dependency management, and where you want them to run fast. For example, you can write a simple proxy service or a service that serves static files. You can turn these into a service that runs very fast with wasm simd and has no scaling concerns.

Let's get to the FAQ written in their own documentation. All the questions asked in this section are actually a section prepared for you to understand what you cannot do.

FAQ

  1. Can I publish a Worker that uses a tokio or async_std runtime?
  • Not at the moment. All crates in your Worker project must compile to the wasm32-unknown-unknown target. This is more limited in some ways than x86 and ARM64 targets.
  1. Why isn't X in the worker crate?
  • It probably should be, we just haven't had the time to fully implement it or add a library to wrap the FFI. Let us know if you need a feature by opening an issue.
  1. My package exceeds Workers size limits, what should I do?
  • We're working on solutions here, but in the meantime you'll need to minimize the number of crates your code depends on or strip as much as possible from your .wasm binary. Here are some additional steps you can try: https://rustwasm.github.io/book/reference/code-size.html#optimizing-builds-for-code-size

Let's start with the first question above. If you want to use tokio or async_std, you currently can't do that. Actually, you can use async; there's no problem with that. However, you'll encounter errors because all the libraries you want to use depend on the two libraries above.

You may have a crate you want to use, but you may see that it doesn't work. It may be due to the crate itself or because one of its dependencies doesn't target wasm32-unknown-unknown. There's nothing you can do in this case. However, you can report this by opening an issue.

Finally, there's nothing you can do if you exceed the size limits. The only thing you can do in this case is to minimize your dependencies. Even if you add one or two crates here, it will be very easy to exceed the size limits. The only thing you can do in this case is to strip as much as possible from the wasm binary. You can try the steps at the link here for this. However, it still might not be enough, and it wasn't enough in my use cases. Here, as a second option, if you contact the CF team, they can increase your limit specifically for you. Or you can create your own environment with workerd and run it with the limits you want.

Conclusion

In my opinion, Cloudflare Workers is a very nice service. However, it's not fully ready for use yet. There are many issues, especially on the limits side. I believe it will become a much better service once these issues are resolved.

Note: If you think there are any omissions or inaccuracies, please let me know.