[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sc-devel] commit: new pattern termination scheme for event streams

Hi all,

I have committed a new early termination scheme for Patterns. This gets rid of nil event as a termination message. To make things work without having to call a stream when it terminates, Streams that require cleanup now must create
a self-contained cleanup function.

This function is added to the array in ~addToCleanup in its first event.

"Terminators" (i.e. streams created by Pfin, Pfindur, Psync, and EventStreamPlayer) maintain a set of such cleanup functions found in its events. When a terminator or stream requiring cleanup ends, it executes those cleanup functions, and then adds them to ~removeFromCleanup and
propagates them up the tree.

Terminators remove any functions found in ~removeFromCleanup from their sets of cleanup funcitons.