mirror of
https://github.com/denoland/deno.git
synced 2024-12-11 18:17:48 -05:00
21 lines
462 B
TypeScript
21 lines
462 B
TypeScript
|
// 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");
|
||
|
}
|
||
|
|
||
|
Deno.serve({
|
||
|
port: 0,
|
||
|
onListen({ port }) {
|
||
|
console.log(port.toString());
|
||
|
},
|
||
|
handler: async (_req) => {
|
||
|
using _span = new Deno.tracing.Span("outer span");
|
||
|
await inner();
|
||
|
return new Response(null, { status: 200 });
|
||
|
},
|
||
|
});
|