Skip to content

Commit

Permalink
Mark MemoryCache as experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Feb 21, 2024
1 parent 900f65a commit 8dfa936
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
19 changes: 2 additions & 17 deletions samples/volatile-cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,11 @@
To run the example on http://localhost:8080

```sh
$ ./workerd serve config.capnp
$ ./workerd serve --experimental config.capnp
```

To run using bazel

```sh
$ bazel run //src/workerd/server:workerd -- serve ~/cloudflare/workerd/samples/helloworld_esm/config.capnp
```

To create a standalone binary that can be run:

```sh
$ ./workerd compile config.capnp > helloworld

$ ./helloworld
```

To test:

```sh
% curl http://localhost:8080
Hello World
$ bazel run //src/workerd/server:workerd -- serve ~/cloudflare/workerd/samples/helloworld_esm/config.capnp --experimental
```
5 changes: 5 additions & 0 deletions src/workerd/server/server.c++
Original file line number Diff line number Diff line change
Expand Up @@ -2423,6 +2423,11 @@ static kj::Maybe<WorkerdApi::Global> createBinding(
return makeGlobal(Global::UnsafeEval {});
}
case config::Worker::Binding::MEMORY_CACHE: {
if (!experimental) {
errorReporter.addError(kj::str(
"MemoryCache bindings are an experimental feature which may change or go away "
"in the future. You must run workerd with `--experimental` to use this feature."));
}
auto cache = binding.getMemoryCache();
// TODO(cleanup): Should we have some reasonable default for these so they can
// be optional?
Expand Down

0 comments on commit 8dfa936

Please sign in to comment.