what is libuv

Callbacks to implement Event Emitters

  • when working with libuv you may encounter callbacks that are meant to be invoked more than once
  • this allows us to build simple event emitters supporting one subscriber per event
struct luv_server_s {
  uv_tcp_t      tcp;
  [..]
  void*         data;
  /* events */
  luv_onclient_connected onclient_connected;
  luv_onclient_disconnected onclient_disconnected;
  luv_onclient_msg onclient_msg;
};