A computer-implemented method for continuously processing an input stream of events (251 - 258) to obtain an output stream of events, wherein each of the events (251 - 258) of the input stream has an event value, the method comprising: selecting, from the input stream of events (251 - 258), a plurality of consecutive events using a sliding window to obtain sliding window events; applying a function to the values of the sliding window events to obtain an output result value; in each of a plurality of iterations: outputting the output result value in the output stream of events; splitting the sliding window events into a set of complying events satisfying at least one filter test and a set of remaining pending events; storing the set of complying events in a cache memory being a random access memory and the set of pending events in a non-volatile memory; applying the function to the values of the set of pending events to obtain at least one preliminary value and storing the at least one preliminary value in the cache memory; selecting, from the input stream of events (251 - 258), a second plurality of events, wherein the second plurality of events comprises new events that are newly received at the input stream of events; adding the second plurality of events to the sliding window events; removing, from the sliding window events, the set of complying events to obtain an updated set of sliding window events; retrieving the at least one preliminary value from the cache memory; applying the function to the values of the second plurality of events to obtain a head result; and applying the function to the head result and the at least one preliminary value to obtain an updated output result value. selecting, from the input stream of events (251 - 258), a plurality of consecutive events using a sliding window to obtain sliding window events; applying a function to the values of the sliding window events to obtain an output result value; in each of a plurality of iterations: outputting the output result value in the output stream of events; splitting the sliding window events into a set of complying events satisfying at least one filter test and a set of remaining pending events; storing the set of complying events in a cache memory being a random access memory and the set of pending events in a non-volatile memory; applying the function to the values of the set of pending events to obtain at least one preliminary value and storing the at least one preliminary value in the cache memory; selecting, from the input stream of events (251 - 258), a second plurality of events, wherein the second plurality of events comprises new events that are newly received at the input stream of events; adding the second plurality of events to the sliding window events; removing, from the sliding window events, the set of complying events to obtain an updated set of sliding window events; retrieving the at least one preliminary value from the cache memory; applying the function to the values of the second plurality of events to obtain a head result; and applying the function to the head result and the at least one preliminary value to obtain an updated output result value. outputting the output result value in the output stream of events; splitting the sliding window events into a set of complying events satisfying at least one filter test and a set of remaining pending events; storing the set of complying events in a cache memory being a random access memory and the set of pending events in a non-volatile memory; applying the function to the values of the set of pending events to obtain at least one preliminary value and storing the at least one preliminary value in the cache memory; selecting, from the input stream of events (251 - 258), a second plurality of events, wherein the second plurality of events comprises new events that are newly received at the input stream of events; adding the second plurality of events to the sliding window events; removing, from the sliding window events, the set of complying events to obtain an updated set of sliding window events; retrieving the at least one preliminary value from the cache memory; applying the function to the values of the second plurality of events to obtain a head result; and applying the function to the head result and the at least one preliminary value to obtain an updated output result value.