Cloudflare workers still need more time. They are currently marked as WIP. Let's start by mentioning the scenarios where they are a good choice. You can use them in your projects that have manageable dependency management with a small file size and that you want to run fast. For example, you can write a simple proxy service or a service that serves static files. With wasm simd, you can make them into services that run very quickly and don't have scaling issues.

Now, let's talk about the FAQ section in its own documentation. All the questions asked in this section have been prepared to help you understand what you cannot do.

FAQ

  1. Can I deploy a Worker that uses tokio or async_std runtimes?
  • Currently no. All crates in your Worker project must compile to wasm32-unknown-unknown target, which is more limited in some ways than targets for x86 and ARM64.
  1. The worker crate doesn't have X! Why not?
  • Most likely, it should, we just haven't had the time to fully implement it or add a library to wrap the FFI. Please let us know you need a feature by opening an issue.
  1. My bundle size exceeds Workers size limits, what do 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 from the .wasm binary as possible. Here are some extra 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 cannot do this at the moment. You can use async, there's no problem there. But you'll encounter errors because all the libraries you'll want to use depend on the two libraries mentioned above.

Suppose you have a crate you want to use, but you might find that it doesn't work. It could be due to the crate itself or one of its dependencies not targeting wasm32-unknown-unknown. There's nothing you can do in this case. But you can point this out by opening an issue.

Finally, if you exceed the size limits, there's nothing you can do. 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 is to remove as much as possible from your wasm binary. You can try the steps in this link for this. But this may not be enough; it wasn't enough in my use cases. As a second option here, the CF team can increase your limits specifically if you contact them. Or you can create your own workerd environment and run it at the limits you want there.

Conclusion

In my opinion, Cloudflare workers are a great service. But they are not fully ready for use yet. There are many problems, especially with the limits. I believe that it will be a much better service once these problems are solved.

Note: If you believe there is anything missing or incorrect, please let me know.