Diffinery

homeflare/celldpublic

23 lines · 589 BRaw History
1# Dynamic Worker tails
2
3This example loads a Worker from a source string. The loaded Worker returns a
4response and writes one console record.
5
6`DynamicWorkerTail` receives the invocation event after the response is
7available. It copies the captured record into the loader Worker's logs and adds
8the `workerId` prop.
9
10Run the example and enable log output:
11
12```sh
13celld dev . --logs
14```
15
16Send a request from another terminal:
17
18```sh
19curl http://127.0.0.1:8787
20```
21
22The request returns `Hello from a Dynamic Worker!`. The celld output contains
23`dynamic-worker-tail: hello from loaded code`.