Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for callback/event based "streaming" handling? #219

Open
Apollon77 opened this issue Sep 10, 2022 · 0 comments
Open

Add option for callback/event based "streaming" handling? #219

Apollon77 opened this issue Sep 10, 2022 · 0 comments

Comments

@Apollon77
Copy link
Contributor

Apollon77 commented Sep 10, 2022

node-ical processes the whole fiel and converts it to "object structure".

I think we could add a "per event callback/event" and when this was added simply call the callback/emit event for each "parsed" object and do not collect all events in this case ... this approach could limit the RAM uses a lot

Hhmmm ... ok we need in any case remember Uids we already processed and maybe use events and have "newEntry" and "updateEntry" (https://github.com/jens-maus/node-ical/blob/master/ical.js#L462). Alternatively adjust to a "two stage" parsing approach to first find out uids and "start/end positions" in the input string to be able to parse uids together then in second stage..
Additional idea to reduce RAM usage would be to not split the whole data to array directly at the beginnig, but use the text and process it by always searching for next line end - would be interesting how such an approach behaves runtime wise ... having one "regexSplit" at the beginning vs. many strPos on big string with "startIndex"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant