cloudflare / workerd

The JavaScript / Wasm runtime that powers Cloudflare Workers
https://blog.cloudflare.com/workerd-open-source-workers-runtime/
Apache License 2.0
6.29k stars 309 forks source link

Refactor Observer and LimitEnforcer cleaner for... #3114

Open danlapid opened 1 week ago

danlapid commented 1 week ago

isolate pools

danlapid commented 1 week ago

More info on internal PR #9192

danlapid commented 1 week ago

Much of this is basically a revert of https://github.com/cloudflare/workerd/pull/3034 for an even cleaner implementation. Previously ownership was shared by WorkerdApi and Worker::Isolate. Then I made WorkerdApi the owner but that has it's own limitations. This PR separates the parts of IsolateObserver and LimitEnforcer that each of WorkerdApi and Worker::Isolate own to their own separate classes in a way that allows each of them to own it's own part.