go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/_motor/providers/os/events/README.md (about)

     1  # Motor Events
     2  
     3  Motor events implement a watcher on file and commands, so that the user of the library has the latest information available.
     4  
     5  It implements that by two different mechanism:
     6  
     7  * polling
     8  * pushing
     9  
    10  By default, we assume polling since it works across all motor transports, while pushing is a special optimization for specific transports. Motor Events abstracts that mechanism away, therefore users do not need to take care about.
    11  
    12                 ┌────────────────┐
    13                 │    Watcher     │
    14                 └────────────────┘
    15                          │
    16          ┌───────────────┴──────────────┐
    17          ▼                              ▼
    18  ┌───────────────┐              ┌───────────────┐
    19  │  eg. iNotify  │              │    polling    │
    20  └───────────────┘              └───────────────┘
    21          │                              │
    22          │                              ▼
    23          │                      ┌───────────────┐
    24          │                      │   runnable    │
    25          │                      └───────────────┘
    26          │                              │
    27          │                              ▼
    28          │                      ┌───────────────┐
    29          │                      │     diff      │
    30          │                      └───────────────┘
    31          │                              │
    32          │      ┌────────────────┐      │
    33          └─────▶│    update()    │◀─────┘
    34                 └────────────────┘