Internal details

Deno and Linux analogy

LinuxDeno
ProcessesWeb Workers
SyscallsOps
File descriptors (fd)Resource ids (rid)
SchedulerTokio
Userland: libc++ / glib / boosthttps://deno.land/std/
/proc/$$/statDeno.metrics()
man pagesdeno types

Resources

Resources (AKA rid) are Deno’s version of file descriptors. They are integer values used to refer to open files, sockets, and other concepts. For testing it would be good to be able to query the system for how many open resources there are.

  1. console.log(Deno.resources());
  2. // { 0: "stdin", 1: "stdout", 2: "stderr" }
  3. Deno.close(0);
  4. console.log(Deno.resources());
  5. // { 1: "stdout", 2: "stderr" }

Metrics

Metrics is Deno’s internal counter for various statistics.

  1. > console.table(Deno.metrics())
  2. ┌──────────────────┬────────┐
  3. (index) Values
  4. ├──────────────────┼────────┤
  5. opsDispatched 9
  6. opsCompleted 9
  7. bytesSentControl 504
  8. bytesSentData 0
  9. bytesReceived 856
  10. └──────────────────┴────────┘

Schematic diagram

architectural schematic

Conference

Ryan Dahl. (May 27, 2020). An interesting case with Deno. Deno Israel.