Skip to content

Add harFromMessagesAsync for streams of messages - #165

Merged
soulgalore merged 1 commit into
mainfrom
add-har-from-messages-async
Nov 3, 2026
Merged

soulgalore merged 1 commit into
mainfrom
add-har-from-messages-async

Conversation

@soulgalore

Copy link
Copy Markdown
Member

People who collect DevTools events as a stream, for example from a live CDP session, had to collect every message into an array before they could create a HAR. For long sessions that means keeping a lot of raw messages in memory only to pass them on.

harFromMessagesAsync takes an async iterable and handles each message when it arrives. harFromMessages stays synchronous with the same API, so existing users are not affected and no major release is needed. Both functions share the same code, so they give the same HAR.

Based on the idea and first implementation by Modeeeeeee in #133.

Assisted-by: Claude Opus 5.5 [email protected]

People who collect DevTools events as a stream, for example from a live CDP session, had to collect every message into an array before they could create a HAR. For long sessions that means keeping a lot of raw messages in memory only to pass them on.

harFromMessagesAsync takes an async iterable and handles each message when it arrives. harFromMessages stays synchronous with the same API, so existing users are not affected and no major release is needed. Both functions share the same code, so they give the same HAR.

Based on the idea and first implementation by Modeeeeeee in #133.

Assisted-by: Claude Opus 5.5 [email protected]
@soulgalore
soulgalore merged commit 77f7a03 into main Nov 3, 2026
3 checks passed
@soulgalore soulgalore mentioned this pull request Nov 3, 2026
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

Successfully merging this pull request may close these issues.

1 participant