-
Notifications
You must be signed in to change notification settings - Fork 3
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
Binary data implementation #296
Merged
Merged
Conversation
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
We toThrow expect Error intance, but BaseError is not inheriting from it.
freaz
force-pushed
the
feature/binary-data
branch
from
November 16, 2022 15:21
f6c9936
to
f31f027
Compare
freaz
force-pushed
the
feature/binary-data
branch
5 times, most recently
from
November 29, 2022 14:46
778dcbb
to
691614a
Compare
freaz
force-pushed
the
feature/binary-data
branch
2 times, most recently
from
November 30, 2022 19:51
8eaa298
to
a8e66e7
Compare
freaz
force-pushed
the
feature/binary-data
branch
from
December 1, 2022 16:10
a8e66e7
to
36309ac
Compare
freaz
force-pushed
the
feature/binary-data
branch
from
December 2, 2022 09:19
36309ac
to
5806821
Compare
TheEdward162
reviewed
Dec 2, 2022
freaz
reviewed
Dec 2, 2022
TheEdward162
reviewed
Dec 6, 2022
freaz
force-pushed
the
feature/binary-data
branch
from
December 7, 2022 10:01
062be58
to
62ae7e4
Compare
TheEdward162
approved these changes
Dec 7, 2022
freaz
force-pushed
the
feature/binary-data
branch
from
December 8, 2022 14:06
731d5c2
to
69a92ad
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In this pull request is introduced new "primitive" type
BinaryData
.If
BinaryData
instance gets to be used as body or value inFormData
, it is streamed.If
BinaryData
should be returned as outcome, anUnexpectedError
is returned. To solve it, callgetAllData()
to read stream intoBuffer
. Later streamed results will be added.Limitations
1. Asynchronous operations on BinaryData
Current limitation for use in Comlink Map is that
peek
,read
andgetAllData
methods are asynchronous. So, they can't be directly chained with function on Buffer. Most likelytoString()
.To overcome this limitation, It must be first set into variable, so the interpreter resolves the Promise:
Opaque data type
In profile, the type must be omitted for now. Later we may add it to Comlink Profile as new Primitive.
Comlink Map examples
Send file in body:
Send file as FormData field:
Send file by chunks:
Read first bytes of file and then send it in body:
OneSDK use example
From user perspective it is used as followed:
Motivation and Context
To allow the passing of binary data with capabilities like async loading, streaming and chunking.
Types of changes
Checklist: