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