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.

ExampleWhat it demonstratesCommand
ProtoSymbolic candidates for login responsesraku -Ilib examples/proto.raku
SignaturesDispatch by type, named argument and defaultraku -Ilib examples/proto-signatures.raku
Recursive protoLeaf family and groups with nested capturesraku -Ilib examples/proto-recursive.raku
InheritanceSubclass extending a pattern familyraku -Ilib examples/proto-inheritance.raku
PartitionsStrict sequences isolated by IPraku -Ilib examples/partition.raku
Partition changeClient, order and scope restorationraku -Ilib examples/partition-change.raku
Positionals$0 in actions and index access on the resultraku -Ilib examples/positional.raku
InterleavingInterleaved branches with &&& and a window on TOPraku -Ilib examples/interleave.raku
SelectionAll, first and last completionraku -Ilib examples/selection.raku
Event timeOut-of-order replay with :latenessraku -Ilib examples/event-time.raku
ConjunctionComplete branches in reverse order with &raku -Ilib examples/unordered.raku
PriorityResult held by `` and released at EOFraku -Ilib examples/ordered-choice.raku
SequenceTwo interleaved sessionsraku -Ilib examples/runner.raku
ObjectsRaku class, subclasses and attribute filtersraku -Ilib examples/objects.raku
PredicatesEquivalent forms with map, * > 40 and block with $_raku -Ilib examples/predicates.raku
CorrelationOrders and payments arriving in different ordersraku -Ilib examples/correlation.raku
AlternativesApproval or rejection using the initial captureraku -Ilib examples/alternatives.raku
Repetition+ emitting progress at every valid completionraku -Ilib examples/repetition.raku
Strict modeDifference between ignoring noise and invalidating a partial matchraku -Ilib examples/strict.raku
Re-emit:reemit<info> preserving selected inputsraku -Ilib examples/reemit.raku
PipelineA .match recognizing objects produced by the previous oneraku -Ilib examples/match.raku
Live streamSupplier, subscription before emission and shutdownraku -Ilib examples/live.raku
RecursionNested blocks with ~ and recursive call to TOPraku -Ilib examples/nested.raku
Decimal windowSequence bounded by 1.5hraku -Ilib examples/time-window.raku
Missing closeFAILGOAL and handling by the quit callbackraku -Ilib examples/missing-close.raku
Fire risk with assertionsNamed positive capture, heat/humidity in either order, and named absence of rain confirmed by window or EOFraku -Ilib examples/fire-risk-2.raku
Fire riskTemperature and humidity of the same area, in any order, within 5minraku -Ilib examples/fire-risk.rakumod
LoginForm, unsuccessful attempts and authenticationraku -Ilib examples/login
Port knockingTwo door sequences correlated by IPraku -Ilib examples/port-knocking.rakumod

Key points

  • $events.match(Type) returns instances of the recognized event.

  • :type(Temperature) recognizes the class and its subclasses. .data preserves the received object.

  • :reemit selects 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; :lateness controls 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.t

In 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.

EEL v0.3

Recognize correlated event streams with RakuAST patterns, reactive Supplies and a log-processing CLI

Authors

  • Fernando Correa de Oliveira

License

Artistic-2.0

Dependencies

JSON::Fast

Test Dependencies

Provides

  • EEL
  • EEL::Absence
  • EEL::Assertion
  • EEL::CLI
  • EEL::Clock
  • EEL::Condition
  • EEL::Continuation
  • EEL::DeadlineQueue
  • EEL::Definition
  • EEL::Input
  • EEL::InputQueue
  • EEL::IntervalIndex
  • EEL::MemoryStorage
  • EEL::Metadata
  • EEL::Query
  • EEL::Reemit
  • EEL::RetainedStore
  • EEL::Runner
  • EEL::SearchIndex
  • EEL::Slang
  • EEL::State
  • EEL::SupplyMatch
  • Event
  • MetamodelX::Event

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.