Whether we are delivering events via function call, shared memory queue, logfile, socket, or coroutine switch, we have the same question of what information is delivered in an event, and how is it encoded.

By default, especially if we want to be able to use existing Unicon monitors to monitor Python, we should adopt an event model as close to Unicon's as possible. Unicon events consist of an 8-bit code (represented as a char) plus an associated language value. Of course, most events will have several associated pieces of information. And, we probably should transmit via C language values rather than Python or Unicon, so here is a sample struct we could use:

struct event {
   char code;      /* E_Line, E_Loc, ... */
   /* any universal attributes go here */
   union {
      struct loc {
         int line; /* line number */
         int col;  /* column number (optional) */
         char *filename; /* source file */
      } loc;
   } u;
);



Edit Me