# State-Machine

```mermaid
graph TD
ON_BEFORE_PROCESS_IMAGE>ON_BEFORE_PROCESS_IMAGE]
ON_EXECUTE_WRITE>ON_EXECUTE_WRITE]

ON_EXECUTE_WRITE ==> WRITE
INITIAL_WAIT -.- ON_EXECUTE_WRITE

WRITE -->|write finished| WAIT_BEFORE_READ
WAIT_BEFORE_READ -->|sleep| READ
READ -->|read finished| FINISHED

ON_BEFORE_PROCESS_IMAGE ==> INITIAL_WAIT
FINISHED -.-o ON_BEFORE_PROCESS_IMAGE
```

View using Mermaid, e.g. https://mermaid-js.github.io/mermaid-live-editor