2024-11-13 05:38:46 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
|
|
|
|
async function inner() {
|
|
|
|
using _span = new Deno.tracing.Span("inner span");
|
|
|
|
console.log("log 1");
|
|
|
|
await 1;
|
|
|
|
console.log("log 2");
|
|
|
|
}
|
|
|
|
|
2024-11-14 07:16:28 -05:00
|
|
|
const server = Deno.serve({
|
2024-11-13 05:38:46 -05:00
|
|
|
port: 0,
|
2024-11-14 07:16:28 -05:00
|
|
|
async onListen({ port }) {
|
|
|
|
try {
|
|
|
|
await fetch(`http://localhost:${port}`);
|
|
|
|
} finally {
|
|
|
|
server.shutdown();
|
|
|
|
}
|
2024-11-13 05:38:46 -05:00
|
|
|
},
|
|
|
|
handler: async (_req) => {
|
|
|
|
using _span = new Deno.tracing.Span("outer span");
|
|
|
|
await inner();
|
|
|
|
return new Response(null, { status: 200 });
|
|
|
|
},
|
|
|
|
});
|