| 1 | /** |
| 2 | * Async (non-Effect) producer fixture for `TailConsumers.local.test.ts`. |
| 3 | * |
| 4 | * Logs a stable marker on every request so each invocation produces trace |
| 5 | * events for the tail consumers attached via `tailConsumers` — the local |
| 6 | * test polls the consumer's `/events` route for a batch carrying this |
| 7 | * marker (trace `scriptName` is workerd's internal service name locally, |
| 8 | * so the marker — not the script name — anchors the assertion). |
| 9 | * |
| 10 | * The marker string is duplicated in `TailConsumers.local.test.ts`: the |
| 11 | * default export must be this module's ONLY export — extra named exports |
| 12 | * surface as workerd top-level exports and fail startup validation |
| 13 | * ("Incorrect type for map entry ...: not of type 'function or |
| 14 | * ExportedHandler'"). |
| 15 | */ |
| 16 | |
| 17 | export default { |
| 18 | async fetch(): Promise<Response> { |
| 19 | console.log("alchemy-local-tail-marker"); |
| 20 | return new Response("producer-ok"); |
| 21 | }, |
| 22 | }; |