EEL — README
EEL Examples
Run the commands at the repository root. All examples are finite.
Expected output is documented with # OUTPUT: comments where provided.
A suggested reading order is: sequence → objects → correlation → alternatives → repetition → strict mode → re-emit → pipeline → recursion → windows.
| Example | What it demonstrates | Command | ||
|---|---|---|---|---|
| Proto | Symbolic candidates for login responses | raku -Ilib examples/proto.raku | ||
| Signatures | Dispatch by type, named argument and default | raku -Ilib examples/proto-signatures.raku | ||
| Recursive proto | Leaf family and groups with nested captures | raku -Ilib examples/proto-recursive.raku | ||
| Inheritance | Subclass extending a pattern family | raku -Ilib examples/proto-inheritance.raku | ||
| Partitions | Strict sequences isolated by IP | raku -Ilib examples/partition.raku | ||
| Partition change | Client, order and scope restoration | raku -Ilib examples/partition-change.raku | ||
| Positionals | $0 in actions and index access on the result | raku -Ilib examples/positional.raku | ||
| Interleaving | Interleaved branches with &&& and a window on TOP | raku -Ilib examples/interleave.raku | ||
| Selection | All, first and last completion | raku -Ilib examples/selection.raku | ||
| Event time | Out-of-order replay with :lateness | raku -Ilib examples/event-time.raku | ||
| Conjunction | Complete branches in reverse order with & | raku -Ilib examples/unordered.raku | ||
| Priority | Result held by ` | ` and released at EOF | raku -Ilib examples/ordered-choice.raku | |
| Sequence | Two interleaved sessions | raku -Ilib examples/runner.raku | ||
| Objects | Raku class, subclasses and attribute filters | raku -Ilib examples/objects.raku | ||
| Predicates | Equivalent forms with map, * > 40 and block with $_ | raku -Ilib examples/predicates.raku | ||
| Correlation | Orders and payments arriving in different orders | raku -Ilib examples/correlation.raku | ||
| Alternatives | Approval or rejection using the initial capture | raku -Ilib examples/alternatives.raku | ||
| Repetition | + emitting progress at every valid completion | raku -Ilib examples/repetition.raku | ||
| Strict mode | Difference between ignoring noise and invalidating a partial match | raku -Ilib examples/strict.raku | ||
| Re-emit | :reemit<info> preserving selected inputs | raku -Ilib examples/reemit.raku | ||
| Pipeline | A .match recognizing objects produced by the previous one | raku -Ilib examples/match.raku | ||
| Live stream | Supplier, subscription before emission and shutdown | raku -Ilib examples/live.raku | ||
| Recursion | Nested blocks with ~ and recursive call to TOP | raku -Ilib examples/nested.raku | ||
| Decimal window | Sequence bounded by 1.5h | raku -Ilib examples/time-window.raku | ||
| Missing close | FAILGOAL and handling by the quit callback | raku -Ilib examples/missing-close.raku | ||
| Fire risk with assertions | Named positive capture, heat/humidity in either order, and named absence of rain confirmed by window or EOF | raku -Ilib examples/fire-risk-2.raku | ||
| Fire risk | Temperature and humidity of the same area, in any order, within 5min | raku -Ilib examples/fire-risk.rakumod | ||
| Login | Form, unsuccessful attempts and authentication | raku -Ilib examples/login | ||
| Port knocking | Two door sequences correlated by IP | raku -Ilib examples/port-knocking.rakumod |
Key points
$events.match(Type)returns instances of the recognized event.:type(Temperature)recognizes the class and its subclasses..datapreserves the received object.:reemitselects inputs for the output; all of them are still considered for recognition.Each completion of a repetition can produce a result: previous results remain independent.
Strict mode considers events of the current partition; without
:partition, the whole stream is relevant. Correlating by a field does not create a partition.Windows use event timestamps. The decimal example replays one hour of historical data immediately;
:latenesscontrols reordering and the watermark.Months are fixed periods of 30 days, and years of 365 days.
The examples use use EEL and Supply.match.
To automatically verify the output of examples with documented output:
raku -Ilib t/10-examples.tIn the proto examples, :sym identifies candidates. Multis by signature use
Raku's dispatch rules; symbolic candidates represent independent
recognitions. That is why a leaf and the group containing it can produce separate
events. The examples catch errors from the Supply and report them after execution.
Fire risk with assertions
fire-risk-2.raku is finite. <data=?event: :area(*.defined)> captures the area
without consuming the reading; that occurrence can also satisfy dry or hot.
After both thresholds match, <no-rain=!rain: :$!area> waits for confirmation
that no rain occurred in that area. The five-minute window starts with the first
consumed reading; crossing its deadline confirms the terminal absence. EOF also
confirms it, even when the full duration was not observed: the example prints
window for A and eof for C. Rain in B prevents B from producing a result.