-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ArrayBuffer support in k6/ws module
I experimented with overriding the first argument passed to the 'message' handler to be a String object with a `buffer` data property, but it doesn't expose the string primitive properties (.length, etc.) so it would be a breaking change. Passing the ArrayBuffer as the second argument is backwards compatible, and hopefully doesn't cause a doubling of memory usage (I'm expecting it to be garbage collected if the argument isn't used). We could detect the number of arguments defined on the handler and only pass the ArrayBuffer if expected, but this would be awkward to implement. Part of #1020
- Loading branch information
Ivan Mirić
committed
Apr 6, 2021
1 parent
a5c7378
commit 9fd189d
Showing
2 changed files
with
89 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters