sse icon indicating copy to clipboard operation
sse copied to clipboard

Introduce EventLog BufferSize

Open tchaton opened this issue 1 year ago • 1 comments

Hey there,

Thanks for this nice framework.

I would like to request the addition of a mechanism to limit the size of the EventLog to tail the latest ones in memory.

This can be done by patching the EventLog as follows:

	if len(stream.Eventlog) >= Limitsize {
		L := len(stream.Eventlog)
		stream.Eventlog =stream.Eventlog[L-Limitsize : L-1]
	}

tchaton avatar Aug 16 '23 10:08 tchaton

Hi! Same problem, current implementation of EventLog is memory leaking) I think some kind of circular/ring buffer be better, than copy and extend slice every time.

aywan avatar Sep 22 '23 11:09 aywan